├── LICENSE
├── includes
├── _errors.md
├── _userlevels.md
├── channel
│ ├── _get.md
│ ├── _introduction.md
│ ├── _post_join.md
│ ├── _post_part.md
│ └── _post_send.md
├── commands
│ ├── _delete_id.md
│ ├── _get.md
│ ├── _get_id.md
│ ├── _introduction.md
│ ├── _post.md
│ ├── _put_id.md
│ └── default
│ │ ├── _get.md
│ │ ├── _get_name.md
│ │ └── _put_name.md
├── me
│ ├── _get.md
│ └── _introduction.md
├── oauth
│ ├── _auth_code_flow.md
│ ├── _basic_steps.md
│ ├── _implicit_flow.md
│ ├── _introduction.md
│ ├── _refreshing_tokens.md
│ ├── _revoking_tokens.md
│ └── _scopes.md
├── regulars
│ ├── _delete_id.md
│ ├── _get.md
│ ├── _get_id.md
│ ├── _introduction.md
│ └── _post.md
├── song_requests
│ ├── _get.md
│ ├── _introduction.md
│ ├── _put.md
│ ├── playlist
│ │ ├── _delete.md
│ │ ├── _delete_id.md
│ │ ├── _get.md
│ │ ├── _get_id.md
│ │ ├── _post.md
│ │ └── _post_import.md
│ └── queue
│ │ ├── _delete.md
│ │ ├── _delete_id.md
│ │ ├── _get.md
│ │ ├── _get_id.md
│ │ ├── _post.md
│ │ ├── _post_id_promote.md
│ │ ├── _post_pause.md
│ │ ├── _post_play.md
│ │ └── _post_skip.md
├── spam_protection
│ ├── _get.md
│ ├── _get_type.md
│ ├── _introduction.md
│ └── _put_type.md
├── subscribers
│ ├── _delete_id.md
│ ├── _get.md
│ ├── _get_id.md
│ ├── _introduction.md
│ └── _post.md
└── timers
│ ├── _delete_id.md
│ ├── _get.md
│ ├── _get_id.md
│ ├── _introduction.md
│ ├── _post.md
│ └── _put_id.md
└── index.html.md
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 Nightbot
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/includes/_errors.md:
--------------------------------------------------------------------------------
1 | # Errors
2 |
3 | ```
4 | {
5 | "status": "400",
6 | "message": "channel is not joined"
7 | }
8 | ```
9 |
10 | Any request with a non-200 status code represents an error. We return the status as an HTTP status as well as within the response of API requests to make debugging easier.
11 |
12 | For every error, a human-readable error message is returned under the `message` key. In the future, we will likely expand error handling to include error codes so that each error can be better documented and handled by third parties.
13 |
--------------------------------------------------------------------------------
/includes/_userlevels.md:
--------------------------------------------------------------------------------
1 | # Userlevels
2 |
3 | In order to add access levels to features of Nightbot, we use the following userlevels:
4 |
5 | * **admin** - Nightbot Administrator
6 | * **owner** - Channel Owner/Manager
7 | * **moderator** - Channel Moderator
8 | * **twitch_vip** - Twitch VIP (only for Twitch accounts)
9 | * **soop_vip** - SOOP VIP (only for SOOP accounts)
10 | * **regular** - Nightbot Regular (users in the regulars list)
11 | * **subscriber** - Paid Channel Subscriber (called "Channel Members" on YouTube)
12 | * **everyone** - Normal User (default)
13 |
14 | The userlevels are listed from highest to lowest. Users in higher userlevels acquire the permissions of the levels below them.
15 |
--------------------------------------------------------------------------------
/includes/channel/_get.md:
--------------------------------------------------------------------------------
1 | ## Get channel
2 |
3 | ```cURL
4 | curl -X GET "https://api.nightbot.tv/1/channel" \
5 | -H "Authorization: Bearer 4fb1fed8889ec9d1c319d5b3c9a54b23"
6 |
7 | {
8 | "status": 200,
9 | "channel": {
10 | "_id": "567224fe9511a38f5114cae0",
11 | "createdAt": "2024-02-14T06:34:49.000Z",
12 | "updatedAt": "2024-03-23T03:17:27.568Z",
13 | "name": "testing",
14 | "displayName": "Testing",
15 | "avatar": "https://static-cdn.jtvnw.net/user-default-pictures-uv/dbdc9198-def8-11e9-8681-784f43822e80-profile_image-300x300.png",
16 | "provider": "twitch",
17 | "providerId": "12345678",
18 | "admin": false,
19 | "joined": true,
20 | "botId": "554eb4b73ee1bab94698bae7"
21 | }
22 | }
23 | ```
24 |
25 | Gets the current API user's channel information
26 |
27 | **HTTP Request**
28 |
29 | `GET https://api.nightbot.tv/1/channel`
30 |
31 | **Scope**
32 |
33 | `channel`
34 |
--------------------------------------------------------------------------------
/includes/channel/_introduction.md:
--------------------------------------------------------------------------------
1 | # Channel
2 |
3 | The channel endpoints allow you to get information about the channel as well as join and part the bot.
4 |
5 | ## Channel Resource
6 |
7 |
8 |
9 |
10 |
Fields
11 |
Type
12 |
Description
13 |
14 |
15 |
16 |
17 |
_id
18 |
string
19 |
Channel ID
20 |
21 |
22 |
displayName
23 |
string
24 |
Channel display name
25 |
26 |
27 |
joined
28 |
boolean
29 |
Channel join status
30 |
31 |
32 |
name
33 |
string
34 |
Channel name
35 |
36 |
37 |
plan
38 |
string
39 |
For future use
40 |
41 |
42 |
--------------------------------------------------------------------------------
/includes/channel/_post_join.md:
--------------------------------------------------------------------------------
1 | ## Join channel
2 |
3 | ```cURL
4 | curl -X POST "https://api.nightbot.tv/1/channel/join" \
5 | -H "Authorization: Bearer 4fb1fed8889ec9d1c319d5b3c9a54b23"
6 |
7 | {
8 | "status": 200
9 | }
10 | ```
11 |
12 | Makes Nightbot join (enter) the current user's channel
13 |
14 | **HTTP Request**
15 |
16 | `POST https://api.nightbot.tv/1/channel/join`
17 |
18 | **Scope**
19 |
20 | `channel`
--------------------------------------------------------------------------------
/includes/channel/_post_part.md:
--------------------------------------------------------------------------------
1 | ## Part channel
2 |
3 | ```cURL
4 | curl -X POST "https://api.nightbot.tv/1/channel/part" \
5 | -H "Authorization: Bearer 4fb1fed8889ec9d1c319d5b3c9a54b23"
6 |
7 | {
8 | "status": 200
9 | }
10 | ```
11 |
12 | Makes Nightbot part (leave) the current user's channel
13 |
14 | **HTTP Request**
15 |
16 | `POST https://api.nightbot.tv/1/channel/part`
17 |
18 | **Scope**
19 |
20 | `channel`
--------------------------------------------------------------------------------
/includes/channel/_post_send.md:
--------------------------------------------------------------------------------
1 | ## Send channel message
2 |
3 | ```cURL
4 | curl -X POST "https://api.nightbot.tv/1/channel/send" \
5 | -H "Authorization: Bearer 4fb1fed8889ec9d1c319d5b3c9a54b23" \
6 | -d "message=test%20message"
7 |
8 | {
9 | "status": 200
10 | }
11 | ```
12 |
13 | Makes Nightbot send a message to the channel
14 |
15 | **HTTP Request**
16 |
17 | `POST https://api.nightbot.tv/1/channel/send`
18 |
19 | **Scope**
20 |
21 | `channel_send`
22 |
23 | **Rate Limit**
24 |
25 | This endpoint is rate limited to 1 request per 5 seconds. If exceeded a HTTP 429 "Too Many Requests" response is returned.
26 |
27 | **Body Parameters**
28 |
29 | The following parameters can be sent as a URL encoded string or JSON (using the appropriate `Content-Type` header).
30 |
31 |
32 |
33 |
34 |
Parameter
35 |
Type
36 |
Required
37 |
Description
38 |
39 |
40 |
41 |
42 |
message
43 |
string
44 |
Required
45 |
The message to send to chat. Maximum length: 400 characters
46 |
47 |
48 |
chatId
49 |
string
50 |
Optional
51 |
The chat ID to send chat to. When not provided the message is sent to all chat rooms for this channel. This is only useful for YouTube channels with multiple concurrent chat rooms.
Contains access token expires as a date and client id as a string (of the app the current access token belongs to)
30 |
31 |
32 |
scopes
33 |
array
34 |
Array of scopes this authorization grants access to
35 |
36 |
37 |
38 |
39 | ## User Resource
40 |
41 |
42 |
43 |
44 |
Fields
45 |
Type
46 |
Description
47 |
48 |
49 |
50 |
51 |
_id
52 |
string
53 |
User id
54 |
55 |
56 |
admin
57 |
boolean
58 |
Whether or not the user is a Nightbot administrator
59 |
60 |
61 |
avatar
62 |
string
63 |
User avatar link
64 |
65 |
66 |
displayName
67 |
string
68 |
User display name
69 |
70 |
71 |
name
72 |
string
73 |
User name
74 |
75 |
76 |
provider
77 |
enum
78 |
The auth provider for the user account (twitch, youtube, trovo, noice, soop)
79 |
80 |
81 |
providerId
82 |
string
83 |
The unique id for this user at the auth provider
84 |
85 |
86 |
87 |
--------------------------------------------------------------------------------
/includes/oauth/_auth_code_flow.md:
--------------------------------------------------------------------------------
1 | ## Authorization Code Flow
2 |
3 | **1. Register an app**
4 |
5 | First you need to register an OAuth application on the [applications page](https://nightbot.tv/account/applications) of your account area. Name your app and specify a URL users should be redirected to after authorizing your app. After creating an application, you need to generate a client secret. Click the edit button for your app on the apps page, and then click on the "New Secret" button.
6 |
7 |
10 |
11 | **2. Once you have created an app, you can *302 redirect* users to our authorization endpoint:**
12 |
13 | `https://api.nightbot.tv/oauth2/authorize`
14 |
15 | with the following query string parameters:
16 |
17 |
18 |
19 |
20 |
Parameter
21 |
Values
22 |
Description
23 |
24 |
25 |
26 |
27 |
client_id
28 |
The client ID for the app
29 |
Identifies the client that is making the request. The value passed in this parameter must exactly match the value for the app.
30 |
31 |
32 |
redirect_uri
33 |
One of the redirect url values listed for the app
34 |
Determines where the response is sent. The value of this parameter must exactly match one of the values listed for this app (including the http or https scheme and casing).
35 |
36 |
37 |
response_type
38 |
code
39 |
Determines whether the OAuth 2 endpoint returns an authorization code. Web server applications should use code.
40 |
41 |
42 |
scope
43 |
Space-delimited set of permissions that the application requests.
44 |
Identifies the access that your application is requesting. The values passed in this parameter inform the consent screen that is shown to the user. There is an inverse relationship between the number of permissions requested and the likelihood of obtaining user consent. For information about available scopes, see scopes.
45 |
46 |
47 |
state
48 |
Any string
49 |
Provides any state that might be useful to your application upon receipt of the response. The authorization server roundtrips this parameter, so your application receives the same value it sent. To mitigate against cross-site request forgery (CSRF), it is strongly recommended to include an anti-forgery token in the state, and confirm it in the response.
50 |
51 |
52 |
53 |
54 | Example URL:
55 |
56 | `https://api.nightbot.tv/oauth2/authorize?response_type=code&client_id=d3cfa25e47c9c18e51220e4757d8e57a&redirect_uri=https%3A%2F%2Ftesting.com%2Fcallback&scope=commands%20timers`
57 |
58 | **3. From the URL above users can choose to allow or deny your application access. Users will then be sent back to your application with a code.**
59 |
60 | Successful Response Example:
61 |
62 | `https://your_redirect_uri?code=cfbdb83aaa4d5c2534c23329de35301a`
63 |
64 | Unsuccessful Response Example:
65 |
66 | `https://your_redirect_uri?error=access_denied`
67 |
68 | **4. With the authorization code sent back with the user, you can exchange it for an access token with a POST request to the following endpoint:**
69 |
70 | `https://api.nightbot.tv/oauth2/token`
71 |
72 | ```cURL
73 | curl -X POST "https://api.nightbot.tv/oauth2/token" \
74 | -d "client_id=d3cfa25e47c9c18e51220e4757d8e57a" \
75 | -d "client_secret=50951bf21ec9639b210c7fda38665861" \
76 | -d "grant_type=authorization_code" \
77 | -d "redirect_uri=https%3A%2F%2Ftesting.com%2Fcallback" \
78 | -d "code=cfbdb83aaa4d5c2534c23329de35301a"
79 |
80 | {
81 | "access_token": "4fb1fed8889ec9d1c319d5b3c9a54b23",
82 | "refresh_token": "b98dbbc2e64789532de2c9e7c69b0f89",
83 | "token_type": "bearer",
84 | "expires_in": 2592000,
85 | "scope": "commands timers"
86 | }
87 | ```
88 |
89 | The request must include the following parameters:
90 |
91 |
92 |
93 |
94 |
Field
95 |
Description
96 |
97 |
98 |
99 |
100 |
client_id
101 |
The client ID of the app.
102 |
103 |
104 |
client_secret
105 |
The client secret of the app.
106 |
107 |
108 |
code
109 |
The authorization code returned from the initial request.
110 |
111 |
112 |
grant_type
113 |
As defined in the OAuth 2 specification, this field must contain a
114 | value of authorization_code.
115 |
116 |
117 |
redirect_uri
118 |
One of the redirect URIs listed for the app.
119 |
120 |
121 |
122 |
123 | A successful response from the token endpoint will return an access token and a refresh token.
124 |
125 |
126 |
127 |
128 |
Field
129 |
Description
130 |
131 |
132 |
133 |
134 |
access_token
135 |
The token that can be sent to the Nightbot API.
136 |
137 |
138 |
expires_in
139 |
The remaining lifetime of the access token.
140 |
141 |
142 |
refresh_token
143 |
A token that may be used to obtain a new access token. Refresh tokens
144 | are valid until the user revokes access, they expire, or they are used.
145 |
146 |
147 |
token_type
148 |
Identifies the type of token returned. At this time, this field will
149 | always have the value bearer.
150 |
151 |
152 |
scope
153 |
A space separated list of scopes attached to the token returned.
154 | This should be identical to scopes requested during authorization.
155 |
156 |
157 |
158 |
159 | **5. The access token can then be used to access the Nightbot API. Access tokens last 30 days and then must be replaced either by using the refresh token flow or by reauthorizing the user with OAuth. Refresh tokens last 60 days, and a new one is issued by the refresh token flow should you choose to use it.**
160 |
161 | ```cURL
162 | # Access the API via header
163 | curl -X GET "https://api.nightbot.tv/1/me" \
164 | -H "Authorization: Bearer 4fb1fed8889ec9d1c319d5b3c9a54b23"
165 |
166 | # Access the API via query string
167 | curl -X GET "https://api.nightbot.tv/1/me?access_token=4fb1fed8889ec9d1c319d5b3c9a54b23"
168 | ```
169 |
170 | **Accessing the API via header:**
171 |
172 |
177 |
178 | **Accessing the API via query string:**
179 |
180 |
184 |
--------------------------------------------------------------------------------
/includes/oauth/_basic_steps.md:
--------------------------------------------------------------------------------
1 | ## Basic Steps
2 |
3 | All applications follow a basic pattern when accessing the Nightbot API using OAuth 2. At a high level, you follow four steps:
4 |
5 | **1. Obtain OAuth 2 credentials from the Nightbot Control Panel.**
6 |
7 | Visit the Nightbot Control Panel's Account [Applications](https://nightbot.tv/account/applications) page to obtain OAuth 2 credentials such as a client ID and client secret that are known to both Nightbot and your application.
8 |
9 | **2. Obtain an access token from the Nightbot API.**
10 |
11 | Before your application can access private data using the Nightbot API, it must obtain an access token that grants access to the API. A single access token can grant varying degrees of access to the API. A variable parameter called scope controls the set of operations that an access token permits. During the access-token request, your application sends one or more values in the scope parameter.
12 |
13 | There are several ways to make this request, and they vary based on the type of application you are building. For example, a server-side application might request an access token by exchanging a code redirected from our authorization endpoint, while a JavaScript application might request an access token using a browser redirect to our authorization endpoint.
14 |
15 | Some requests require an authentication step where the user logs in with their Nightbot account (if they are not previously logged in). After logging in, the user is asked whether they are willing to grant the permissions that your application is requesting. This process is called user consent.
16 |
17 | If the user grants the permission, the Nightbot API sends your application an access token (or an authorization code that your application can use to obtain an access token). If the user does not grant the permission, the server returns an error.
18 |
19 | It is generally a best practice to request scopes incrementally, at the time access is required, rather than up front.
20 |
21 | **3. Send the access token to an API.**
22 |
23 | After an application obtains an access token, it sends the token to the Nightbot API in an HTTP authorization header. It is possible to send tokens as URI query-string parameters, but we don't recommend it, because URI parameters can end up in log files that are not completely secure. Also, it is good REST practice to avoid creating unnecessary URI parameter names.
24 |
25 | Access tokens are valid only for the set of operations and resources described in the scope of the token request.
26 |
27 | **4. Refresh the access token, if necessary.**
28 |
29 | Access tokens have limited lifetimes. If your application needs access to the Nightbot API beyond the lifetime of a single access token, it can obtain a refresh token. A refresh token allows your application to obtain new access tokens.
30 |
31 |
34 |
--------------------------------------------------------------------------------
/includes/oauth/_implicit_flow.md:
--------------------------------------------------------------------------------
1 | ## Implicit Flow
2 |
3 | **1. Register an app**
4 |
5 | First you need to register an OAuth application on the [applications page](https://nightbot.tv/account/applications) of your account area. Name your app and specify a URL users should be redirected to after authorizing your app. Because this is a client-side flow, you do not need to generate or use a client secret.
6 |
7 | **2. Once you have created an app, you can *302 redirect* users to our authorization endpoint:**
8 |
9 | `https://api.nightbot.tv/oauth2/authorize`
10 |
11 | with the following query string parameters:
12 |
13 |
14 |
15 |
16 |
Parameter
17 |
Values
18 |
Description
19 |
20 |
21 |
22 |
23 |
client_id
24 |
The client ID for the app
25 |
Identifies the client that is making the request. The value passed in this parameter must exactly match the value for the app.
26 |
27 |
28 |
redirect_uri
29 |
One of the redirect url values listed for the app
30 |
Determines where the response is sent. The value of this parameter must exactly match one of the values listed for this app (including the http or https scheme and casing).
31 |
32 |
33 |
response_type
34 |
token
35 |
Determines whether the OAuth 2 endpoint returns a token in the fragment of the redirect url.
36 |
37 |
38 |
scope
39 |
Space-delimited set of permissions that the application requests.
40 |
Identifies the access that your application is requesting. The values passed in this parameter inform the consent screen that is shown to the user. There is an inverse relationship between the number of permissions requested and the likelihood of obtaining user consent. For information about available scopes, see scopes.
41 |
42 |
43 |
state
44 |
Any string
45 |
Provides any state that might be useful to your application upon receipt of the response. The authorization server roundtrips this parameter, so your application receives the same value it sent. To mitigate against cross-site request forgery (CSRF), it is strongly recommended to include an anti-forgery token in the state, and confirm it in the response.
46 |
47 |
48 |
49 |
50 | Example URL:
51 |
52 | `https://api.nightbot.tv/oauth2/authorize?response_type=token&client_id=d3cfa25e47c9c18e51220e4757d8e57a&redirect_uri=https%3A%2F%2Ftesting.com%2Fcallback&scope=commands%20timers`
53 |
54 | **3. From the URL above users can choose to allow or deny your application access. Users will then be sent back to your application with an access token.**
55 |
56 | Successful Response Example:
57 |
58 | `https://your_redirect_uri#access_token=cfbdb83aaa4d5c2534c23329de35301a&expires_in=2592000&token_type=bearer`
59 |
60 | Unsuccessful Response Example:
61 |
62 | `https://your_redirect_uri#error=access_denied`
63 |
64 | **5. The access token can then be used to access the Nightbot API. Access tokens last 30 days and then must be replaced by reauthorizing the user with OAuth. Refresh tokens are not issued for implicit authorizations, so it is not possible to refresh the access token with this implementation.**
65 |
66 | ```cURL
67 | # Access the API via header
68 | curl -X GET "https://api.nightbot.tv/1/me" \
69 | -H "Authorization: Bearer 4fb1fed8889ec9d1c319d5b3c9a54b23"
70 |
71 | # Access the API via query string
72 | curl -X GET "https://api.nightbot.tv/1/me?access_token=4fb1fed8889ec9d1c319d5b3c9a54b23"
73 | ```
74 |
75 | **Accessing the API via header:**
76 |
77 |
82 |
83 | **Accessing the API via query string:**
84 |
85 |
89 |
--------------------------------------------------------------------------------
/includes/oauth/_introduction.md:
--------------------------------------------------------------------------------
1 | # OAuth 2
2 |
3 | Nightbot uses the OAuth 2 flow for securely authorizing requests to our API. Much of these authorization docs have been adapted from [Google's excellent documentation on OAuth](https://developers.google.com/identity/protocols/OAuth2).
4 |
--------------------------------------------------------------------------------
/includes/oauth/_refreshing_tokens.md:
--------------------------------------------------------------------------------
1 | ## Refreshing Tokens
2 |
3 | ```cURL
4 | curl -X POST "https://api.nightbot.tv/oauth2/token" \
5 | -d "client_id=d3cfa25e47c9c18e51220e4757d8e57a" \
6 | -d "client_secret=50951bf21ec9639b210c7fda38665861" \
7 | -d "grant_type=refresh_token" \
8 | -d "redirect_uri=https%3A%2F%2Ftesting.com%2Fcallback" \
9 | -d "refresh_token=cfbdb83aaa4d5c2534c23329de35301a"
10 |
11 | {
12 | "access_token": "4fb1fed8889ec9d1c319d5b3c9a54b23",
13 | "refresh_token": "b98dbbc2e64789532de2c9e7c69b0f89",
14 | "token_type": "bearer",
15 | "expires_in": 2592000,
16 | "scope": "commands timers"
17 | }
18 | ```
19 |
20 | As indicated in the previous sections, a refresh token is obtained in the token exchange with an authorization code. In this case, your application may obtain a new access token by sending a refresh token to the token endpoint:
21 |
22 | `https://api.nightbot.tv/oauth2/token`
23 |
24 | The request must include the following parameters:
25 |
26 |
27 |
28 |
29 |
Field
30 |
Description
31 |
32 |
33 |
34 |
35 |
client_id
36 |
The client ID of the app.
37 |
38 |
39 |
client_secret
40 |
The client secret of the app.
41 |
42 |
43 |
grant_type
44 |
As defined in the OAuth 2 specification, this field must contain a
45 | value of refresh_token.
46 |
47 |
48 |
redirect_uri
49 |
One of the redirect URIs listed for the app.
50 |
51 |
52 |
refresh_token
53 |
The refresh token of the access token being refreshed.
54 |
55 |
56 |
57 |
58 | The new access token can then be used to access the Nightbot API. Access tokens last 30 days and then must be replaced either by using the **new** refresh token flow or by reauthorizing the user with OAuth. Refresh tokens last 60 days.
59 |
--------------------------------------------------------------------------------
/includes/oauth/_revoking_tokens.md:
--------------------------------------------------------------------------------
1 | ## Revoking Tokens
2 |
3 | ```cURL
4 | curl -X POST "https://api.nightbot.tv/oauth2/token/revoke" \
5 | -d "token=cfbdb83aaa4d5c2534c23329de35301a"
6 | ```
7 |
8 | In some cases a user may wish to revoke access given to an application. A user can revoke access by visiting [Account Applications](https://nightbot.tv/account/applications). It is also possible for an application to programmatically revoke the access given to it. Programmatic revocation is important in instances where a user unsubscribes or removes an application. In other words, part of the removal process can include an API request to ensure the permissions granted to the application are removed.
9 |
10 | To revoke an access or refresh token, pass the token in a **POST** request to the revocation endpoint:
11 |
12 | `https://api.nightbot.tv/oauth2/token/revoke`
13 |
14 | The request must include the following parameters:
15 |
16 |
17 |
18 |
19 |
Field
20 |
Description
21 |
22 |
23 |
24 |
25 |
token
26 |
The access or refresh token being revoked.
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/includes/oauth/_scopes.md:
--------------------------------------------------------------------------------
1 | ## Scopes
2 |
3 | We provide the following scopes to allow you to restrict Nightbot API access to use only what your application requires.
4 |
5 | * **channel** - View and edit channel settings and join/part the bot
6 | * **channel_send** - Ability to send messages to the channel as Nightbot
7 | * **commands** - View, add, edit, and remove channel custom commands
8 | * **commands_default** - View, edit, enable, and disable channel default commands
9 | * **regulars** - View, add, and remove channel regulars
10 | * **song_requests** - View and edit channel song request settings
11 | * **song_requests_queue** - View, add, edit, and remove songs on the channel song request queue
12 | * **song_requests_playlist** - View, add, edit, and remove songs on the channel song request playlist
13 | * **spam_protection** - View, edit, enable, and disable channel spam protection filters
14 | * **subscribers** - View, add, and remove channel subscribers (useful for third party subscription services)
15 | * **timers** - View, add, edit, and remove channel timers
16 |
--------------------------------------------------------------------------------
/includes/regulars/_delete_id.md:
--------------------------------------------------------------------------------
1 | ## Delete regular by id
2 |
3 | ```cURL
4 | curl -X DELETE "https://api.nightbot.tv/1/regulars/56739fb5d0c250946ed67448" \
5 | -H "Authorization: Bearer 4fb1fed8889ec9d1c319d5b3c9a54b23"
6 |
7 | {
8 | "status": 200
9 | }
10 | ```
11 |
12 | Deletes a regular by id
13 |
14 | **HTTP Request**
15 |
16 | `DELETE https://api.nightbot.tv/1/regulars/:id`
17 |
18 | **Scope**
19 |
20 | `regulars`
--------------------------------------------------------------------------------
/includes/regulars/_get.md:
--------------------------------------------------------------------------------
1 | ## Get regulars
2 |
3 | ```cURL
4 | curl -X GET "https://api.nightbot.tv/1/regulars" \
5 | -H "Authorization: Bearer 4fb1fed8889ec9d1c319d5b3c9a54b23"
6 |
7 | {
8 | "_total": 30,
9 | "status": 200,
10 | "regulars": [
11 | {
12 | "_id": "56739fb5d0c250946ed67448",
13 | "createdAt": "2015-12-18T05:55:01.458Z",
14 | "updatedAt": "2015-12-18T05:55:01.458Z",
15 | "provider": "twitch",
16 | "providerId": "96837452",
17 | "name": "test_user",
18 | "displayName": "Test_User"
19 | },
20 | ...
21 | ]
22 | }
23 | ```
24 |
25 | Gets the current API user's regulars list
26 |
27 | **HTTP Request**
28 |
29 | `GET https://api.nightbot.tv/1/regulars`
30 |
31 | **Scope**
32 |
33 | `regulars`
34 |
35 | **Query String Parameters**
36 |
37 |
38 |
39 |
40 |
Parameter
41 |
Type
42 |
Required
43 |
Description
44 |
45 |
46 |
47 |
48 |
limit
49 |
number
50 |
Optional
51 |
The is the maximum amount of regulars to return in the request (minimum 1, maximum 100)
52 |
53 |
54 |
offset
55 |
number
56 |
Optional
57 |
This is the regular offset count that is used for pagination
58 |
59 |
60 |
q
61 |
string
62 |
Optional
63 |
A displayName to search for (case insensitive)
64 |
65 |
66 |
--------------------------------------------------------------------------------
/includes/regulars/_get_id.md:
--------------------------------------------------------------------------------
1 | ## Get regular by id
2 |
3 | ```cURL
4 | curl -X GET "https://api.nightbot.tv/1/regulars/56739fb5d0c250946ed67448" \
5 | -H "Authorization: Bearer 4fb1fed8889ec9d1c319d5b3c9a54b23"
6 |
7 | {
8 | "status": 200,
9 | "regular": {
10 | "_id": "56739fb5d0c250946ed67448",
11 | "createdAt": "2015-12-18T05:55:01.458Z",
12 | "updatedAt": "2015-12-18T05:55:01.458Z",
13 | "provider": "twitch",
14 | "providerId": "96837452",
15 | "name": "test_user",
16 | "displayName": "Test_User"
17 | }
18 | }
19 | ```
20 |
21 | Looks up a regular by id
22 |
23 | **HTTP Request**
24 |
25 | `GET https://api.nightbot.tv/1/regulars/:id`
26 |
27 | **Scope**
28 |
29 | `regulars`
30 |
--------------------------------------------------------------------------------
/includes/regulars/_introduction.md:
--------------------------------------------------------------------------------
1 | # Regulars
2 |
3 | The regulars endpoints allow you to view, add, edit, and remove channel regulars. Nightbot Regulars adds another userlevel to the chat. Regulars can be granted extra permission for commands and spam protection.
4 |
5 | ## Regular Resource
6 |
7 |
8 |
9 |
10 |
Fields
11 |
Type
12 |
Description
13 |
14 |
15 |
16 |
17 |
_id
18 |
string
19 |
Regular id
20 |
21 |
22 |
createdAt
23 |
date
24 |
The time the regular was added
25 |
26 |
27 |
displayName
28 |
string
29 |
User display name
30 |
31 |
32 |
name
33 |
string
34 |
User unique name
35 |
36 |
37 |
provider
38 |
enum
39 |
The auth provider for the regular (twitch, youtube, trovo, noice, soop)
40 |
41 |
42 |
providerId
43 |
string
44 |
The unique id for this user at the auth provider
45 |
46 |
47 |
updatedAt
48 |
date
49 |
The last time the regular was updated
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/includes/regulars/_post.md:
--------------------------------------------------------------------------------
1 | ## Add new regular
2 |
3 | ```cURL
4 | curl -X POST "https://api.nightbot.tv/1/regulars" \
5 | -H "Authorization: Bearer 4fb1fed8889ec9d1c319d5b3c9a54b23" \
6 | -d "name=test_user"
7 |
8 | {
9 | "status": 200,
10 | "regular": {
11 | "_id": "56739fb5d0c250946ed67448",
12 | "createdAt": "2015-12-18T05:55:01.458Z",
13 | "updatedAt": "2015-12-18T05:55:01.458Z",
14 | "provider": "twitch",
15 | "providerId": "96837452",
16 | "name": "test_user",
17 | "displayName": "Test_User"
18 | }
19 | }
20 | ```
21 |
22 | Adds a new regular to the current user's channel
23 |
24 | **HTTP Request**
25 |
26 | `POST https://api.nightbot.tv/1/regulars`
27 |
28 | **Scope**
29 |
30 | `regulars`
31 |
32 | **Body Parameters**
33 |
34 | The following parameters can be sent as a URL encoded string or JSON (using the appropriate `Content-Type` header).
35 |
36 |
37 |
38 |
39 |
Parameter
40 |
Type
41 |
Required
42 |
Description
43 |
44 |
45 |
46 |
47 |
name
48 |
string
49 |
Required
50 |
This is the username of the person you wish to add as a regular. In the case of YouTube, it would be the user's YouTube channel URL.
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/includes/song_requests/_get.md:
--------------------------------------------------------------------------------
1 | ## Get song request settings
2 |
3 | ```cURL
4 | curl -X GET "https://api.nightbot.tv/1/song_requests" \
5 | -H "Authorization: Bearer 4fb1fed8889ec9d1c319d5b3c9a54b23"
6 |
7 | {
8 | "status": 200,
9 | "settings": {
10 | "limits": {
11 | "queue": 20,
12 | "user": 10,
13 | "playlistOnly": false,
14 | "exemptUserLevel": "moderator"
15 | },
16 | "volume": 59,
17 | "enabled": true,
18 | "providers": [
19 | "soundcloud",
20 | "youtube"
21 | ],
22 | "playlist": "channel",
23 | "userLevel": "everyone",
24 | "searchProvider": "soundcloud",
25 | "youtube": {
26 | "limitToMusic": false,
27 | "limitToLikedVideos": true
28 | }
29 | },
30 | "providers": {
31 | "soundcloud": "SoundCloud",
32 | "youtube": "YouTube"
33 | },
34 | "playlists": {
35 | "channel": "Channel",
36 | "monstercat": "Monstercat",
37 | "twitch_music_library": "Twitch Music Library"
38 | }
39 | }
40 | ```
41 |
42 | Gets the current API user's song request settings
43 |
44 | **HTTP Request**
45 |
46 | `GET https://api.nightbot.tv/1/song_requests`
47 |
48 | **Scope**
49 |
50 | `song_requests`
--------------------------------------------------------------------------------
/includes/song_requests/_introduction.md:
--------------------------------------------------------------------------------
1 | # Song Requests
2 |
3 | The song request endpoints allow you to view, add, edit, and delete song from the song request queue and playlist as well as modify the settings for song requests.
4 |
5 | ## Song Request Settings Resource
6 |
7 |
8 |
9 |
10 |
Fields
11 |
Type
12 |
Description
13 |
14 |
15 |
16 |
17 |
enabled
18 |
boolean
19 |
The status of song requests. If true, song requests are enabled and songs can be requested by users. If false, song requests are disabled and are nonfunctional.
20 |
21 |
22 |
limits
23 |
object
24 |
Contains user-configurable song request limits
25 |
26 |
27 |
limits .queue
28 |
number
29 |
The maximum number of songs in the queue (minimum 1, maximum 100)
30 |
31 |
32 |
limits .user
33 |
number
34 |
The maximum number of songs a user can request at a time (minimum 1, maximum 100)
35 |
36 |
37 |
limits .playlistOnly
38 |
boolean
39 |
If true, song requests will be limited to the configured playlist. If false, requests can be made from any listed providers
40 |
41 |
42 |
limits .exemptUserLevel
43 |
enum
44 |
The userlevel required to be exempt from the limits
45 |
46 |
47 |
playlist
48 |
enum
49 |
The playlist AutoDJ will source from when the queue is empty. If limits.playlistOnly is true all requested songs must be on this playlist. Available playlists are listed in the song request settings GET endpoint as playlists.
50 |
51 |
52 |
providers
53 |
array
54 |
An array of enums for the enabled song request providers. Providers are the services which we support pulling songs from. Available providers are listed in the song request settings GET endpoint as providers.
55 |
56 |
57 |
searchProvider
58 |
enum
59 |
Instead of requiring users to request songs with a URL or ID, users can search for the closest match to request a song. This controls where that search is performed. Available providers are listed in the song request settings GET endpoint as providers.
60 |
61 |
62 |
userLevel
63 |
enum
64 |
The userlevel required to be able to request songs
65 |
66 |
67 |
volume
68 |
number
69 |
The volume that the AutoDJ player runs at (minimum 0, maximum 100)
70 |
71 |
72 |
youtube
73 |
object
74 |
YouTube-specific song request settings
75 |
76 |
77 |
youtube .limitToMusic
78 |
boolean
79 |
To reduce non-music videos from being requested, you can limit to just the music category by setting this to true. If set to false, videos are not restricted to just the music category.
80 |
81 |
82 |
youtube .limitToLikedVideos
83 |
boolean
84 |
To reduce bad videos from being requested, you can limit to videos with more likes than dislikes by setting this to true. If set to false, videos with more dislikes than likes are able to be requested. Defaults to true
85 |
86 |
87 |
88 |
89 | ## Playlist Item Resource
90 |
91 |
92 |
93 |
94 |
Fields
95 |
Type
96 |
Description
97 |
98 |
99 |
100 |
101 |
_id
102 |
string
103 |
The playlist item's unique id
104 |
105 |
106 |
createdAt
107 |
date
108 |
The time the playlist item was created
109 |
110 |
111 |
track
112 |
object
113 |
Track Information
114 |
115 |
116 |
track .artist
117 |
string, optional
118 |
Track Artist
119 |
120 |
121 |
track .duration
122 |
number
123 |
Track Duration (in seconds)
124 |
125 |
126 |
track .provider
127 |
enum
128 |
Track Provider (like "youtube" or "soundcloud")
129 |
130 |
131 |
track .providerId
132 |
string
133 |
Track Provider's unique id
134 |
135 |
136 |
track .title
137 |
string
138 |
Track Title
139 |
140 |
141 |
track .url
142 |
string
143 |
Track URL
144 |
145 |
146 |
updatedAt
147 |
date
148 |
The last time the playlist item was updated
149 |
150 |
151 |
152 |
153 | ## Queue Item Resource
154 |
155 |
156 |
157 |
158 |
Fields
159 |
Type
160 |
Description
161 |
162 |
163 |
164 |
165 |
_position
166 |
number, optional
167 |
The queue item's position in the queue
168 |
169 |
170 |
_id
171 |
string
172 |
The queue item's unique id
173 |
174 |
175 |
createdAt
176 |
date
177 |
The time the queue item was created
178 |
179 |
180 |
track
181 |
object
182 |
Track Information
183 |
184 |
185 |
track .artist
186 |
string, optional
187 |
Track Artist
188 |
189 |
190 |
track .duration
191 |
number
192 |
Track Duration (in seconds)
193 |
194 |
195 |
track .provider
196 |
enum
197 |
Track Provider (like "youtube" or "soundcloud")
198 |
199 |
200 |
track .providerId
201 |
string
202 |
Track Provider's unique id
203 |
204 |
205 |
track .title
206 |
string
207 |
Track Title
208 |
209 |
210 |
track .url
211 |
string
212 |
Track URL
213 |
214 |
215 |
user
216 |
object
217 |
Information about who the queue item belongs to
218 |
219 |
220 |
user .displayName
221 |
string
222 |
User display name
223 |
224 |
225 |
user .name
226 |
string
227 |
User unique name
228 |
229 |
230 |
user .provider
231 |
enum
232 |
User provider (twitch, youtube, trovo, noice, soop, discord)
233 |
234 |
235 |
user .providerId
236 |
string
237 |
User provider's unique id
238 |
239 |
240 |
updatedAt
241 |
date
242 |
The last time the queue item was updated
243 |
244 |
245 |
246 |
--------------------------------------------------------------------------------
/includes/song_requests/_put.md:
--------------------------------------------------------------------------------
1 | ## Edit song request settings
2 |
3 | ```cURL
4 | curl -X PUT "https://api.nightbot.tv/1/song_requests" \
5 | -H "Authorization: Bearer 4fb1fed8889ec9d1c319d5b3c9a54b23" \
6 | -d "enabled=false"
7 |
8 | {
9 | "status": 200,
10 | "settings": {
11 | "youtube": {
12 | "limitToMusic": false,
13 | "limitToLikedVideos": true
14 | },
15 | "searchProvider": "soundcloud",
16 | "userLevel": "everyone",
17 | "playlist": "channel",
18 | "providers": ["soundcloud", "youtube"],
19 | "enabled": false,
20 | "volume": 59,
21 | "limits": {
22 | "queue": 20,
23 | "user": 10,
24 | "playlistOnly": false,
25 | "exemptUserLevel": "moderator"
26 | }
27 | },
28 | "providers": {
29 | "soundcloud": "SoundCloud",
30 | "youtube": "YouTube"
31 | },
32 | "playlists": {
33 | "channel": "Channel",
34 | "monstercat": "Monstercat",
35 | "twitch_music_library": "Twitch Music Library"
36 | }
37 | }
38 | ```
39 |
40 | Edits the song request settings
41 |
42 | **HTTP Request**
43 |
44 | `PUT https://api.nightbot.tv/1/song_requests`
45 |
46 | **Scope**
47 |
48 | `song_requests`
49 |
50 | **Body Parameters**
51 |
52 | The following parameters can be sent as a URL encoded string or JSON (using the appropriate `Content-Type` header). `PUT` requests usually require the entire model to be included in the request, but we allow partial updates.
53 |
54 |
55 |
56 |
57 |
Parameter
58 |
Type
59 |
Required
60 |
Description
61 |
62 |
63 |
64 |
65 |
enabled
66 |
boolean
67 |
Optional
68 |
The status of song requests. If true, song requests are enabled and songs can be requested by users. If false, song requests are disabled and are nonfunctional.
69 |
70 |
71 |
limits .queue
72 |
number
73 |
Optional
74 |
The maximum number of songs in the queue (minimum 1, maximum 100)
75 |
76 |
77 |
limits .user
78 |
number
79 |
Optional
80 |
The maximum number of songs a user can request at a time (minimum 1, maximum 100)
81 |
82 |
83 |
limits .playlistOnly
84 |
boolean
85 |
Optional
86 |
If true, song requests will be limited to the configured playlist. If false, requests can be made from any listed providers
87 |
88 |
89 |
limits .playlistOnly
90 |
boolean
91 |
Optional
92 |
If true, song requests will be limited to the configured playlist. If false, requests can be made from any listed providers
93 |
94 |
95 |
limits .exemptUserLevel
96 |
enum
97 |
Optional
98 |
The userlevel required to be exempt from the limits
99 |
100 |
101 |
playlist
102 |
enum
103 |
Optional
104 |
The playlist AutoDJ will source from when the queue is empty. If limits.playlistOnly is true all requested songs must be on this playlist. Available playlists are listed in the song request settings GET endpoint as playlists.
105 |
106 |
107 |
providers
108 |
array
109 |
Optional
110 |
An array of enums for the enabled song request providers. Providers are the services which we support pulling songs from. Available providers are listed in the song request settings GET endpoint as providers.
111 |
112 |
113 |
searchProvider
114 |
enum
115 |
Optional
116 |
Instead of requiring users to request songs with a URL or ID, users can search for the closest match to request a song. This controls where that search is performed. Available providers are listed in the song request settings GET endpoint as providers.
117 |
118 |
119 |
userLevel
120 |
enum
121 |
Optional
122 |
The userlevel required to be able to request songs
123 |
124 |
125 |
volume
126 |
number
127 |
Optional
128 |
The volume that the AutoDJ player runs at (minimum 0, maximum 100)
129 |
130 |
131 |
youtube .limitToMusic
132 |
boolean
133 |
Optional
134 |
To reduce non-music videos from being requested, you can limit to just the music category by setting this to true. If set to false, videos are not restricted to just the music category.
135 |
136 |
137 |
youtube .limitToLikedVideos
138 |
boolean
139 |
Optional
140 |
To reduce bad videos from being requested, you can limit to videos with more likes than dislikes by setting this to true. If set to false, videos with more dislikes than likes are able to be requested. Defaults to true
This is the song to add to the playlist. It can be a URL for one of the supported song request providers or a song name to search for (closest match is chosen and search is performed on the channel's selected search provider)
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/includes/song_requests/playlist/_post_import.md:
--------------------------------------------------------------------------------
1 | ## Import remote playlist
2 |
3 | ```cURL
4 | curl -X POST "https://api.nightbot.tv/1/song_requests/playlist/import" \
5 | -H "Authorization: Bearer 4fb1fed8889ec9d1c319d5b3c9a54b23" \
6 | -d "url=https%3A%2F%2Fwww.youtube.com%2Fplaylist%3Flist%3DPLA11538113C16891A"
7 |
8 | {
9 | "status": 200
10 | }
11 | ```
12 |
13 | Imports a remote playlist to the current user's channel.
14 |
15 | **HTTP Request**
16 |
17 | `POST https://api.nightbot.tv/1/song_requests/playlist/import`
18 |
19 | **Scope**
20 |
21 | `song_requests_playlist`
22 |
23 | **Body Parameters**
24 |
25 | The following parameters can be sent as a URL encoded string or JSON (using the appropriate `Content-Type` header).
26 |
27 |
28 |
29 |
30 |
Parameter
31 |
Type
32 |
Required
33 |
Description
34 |
35 |
36 |
37 |
38 |
url
39 |
string
40 |
Required
41 |
This is the playlist to import. This is a playlist URL located at one of the supported song request providers
This is the song to add to the queue. It can be a URL for one of the supported song request providers or a song name to search for (closest match is chosen and search is performed on the channel's selected search provider)
If the filter contains a limit option, this defines its minimum value
20 |
21 |
22 |
_limitMax
23 |
number, optional
24 |
If the filter contains a limit option, this defines its maximum value
25 |
26 |
27 |
_name
28 |
string
29 |
The spam protection filter name
30 |
31 |
32 |
_type
33 |
enum
34 |
The spam protection filter type
35 |
36 |
37 |
blacklist
38 |
string, optional
39 |
New-line delimited list of blacklisted phrases. Wildcards can be used (`*`). RegEx is also supported (`~/[pattern]/[flags]`). Only can be used with filters supporting a blacklist.
40 |
41 |
42 |
enabled
43 |
boolean
44 |
The status of the filter. If true, the filter is enabled. If false, the filter is disabled and is nonfunctional.
The length of time in seconds that Nightbot will timeout users for if detected by the filter
55 |
56 |
57 |
limit
58 |
number, optional
59 |
The barrier at which the filter should timeout users, should the filter have one.
60 |
61 |
62 |
message
63 |
string
64 |
The timeout message given to a user when they are timed out (if filter is not silenced). If empty string, defaults to Duke Nukem quotes.
65 |
66 |
67 |
silent
68 |
boolean
69 |
If true, the filter will not emit a message to chat telling to user why they were timed out. If false, the filter is will emit a message.
70 |
71 |
72 |
whitelist
73 |
string, optional
74 |
New-line delimited list of whitelisted phrases. For the link whitelist this parses hostnames (like `youtube.com` unless wildcards or regex is used). Wildcards can be used (`*`). RegEx is also supported (`~/[pattern]/[flags]`). Only can be used with filters supporting a whitelist.
75 |
76 |
77 |
78 |
--------------------------------------------------------------------------------
/includes/spam_protection/_put_type.md:
--------------------------------------------------------------------------------
1 | ## Edit filter by type
2 |
3 | ```cURL
4 | curl -X PUT "https://api.nightbot.tv/1/spam_protection/blacklist" \
5 | -H "Authorization: Bearer 4fb1fed8889ec9d1c319d5b3c9a54b23" \
6 | -d "message=testing"
7 |
8 | {
9 | "status": 200,
10 | "filter": {
11 | "enabled": true,
12 | "length": 600,
13 | "blacklist": "◕_◕*\nᴘɪᴢᴢᴀ\nˢʷᵉᵃʳ",
14 | "message": "testing",
15 | "silent": false,
16 | "exemptUserLevel": "subscriber",
17 | "_type": "blacklist",
18 | "_name": "Blacklist Words/Phrases",
19 | "_description": "This filter allows you to timeout custom words, phrases, and patterns.",
20 | "_docs": "https://docs.nightbot.tv/spam-protection/blacklist"
21 | }
22 | }
23 | ```
24 |
25 | Edits a spam protection filter by its type.
26 |
27 | **HTTP Request**
28 |
29 | `PUT https://api.nightbot.tv/1/spam_protection/:type`
30 |
31 | **Scope**
32 |
33 | `spam_protection`
34 |
35 | **Body Parameters**
36 |
37 | The following parameters can be sent as a URL encoded string or JSON (using the appropriate `Content-Type` header). `PUT` requests usually require the entire model to be included in the request, but we allow partial updates.
38 |
39 |
40 |
41 |
42 |
Parameter
43 |
Type
44 |
Required
45 |
Description
46 |
47 |
48 |
49 |
50 |
blacklist
51 |
string
52 |
Optional
53 |
New-line delimited list of blacklisted phrases. Wildcards can be used (`*`). RegEx is also supported (`~/[pattern]/[flags]`). Only can be used with filters supporting a blacklist.
54 |
55 |
56 |
enabled
57 |
boolean
58 |
Optional
59 |
The status of the filter. If true, the filter is enabled. If false, the filter is disabled and is nonfunctional.
The length of time in seconds that Nightbot will timeout users for if detected by the filter
72 |
73 |
74 |
limit
75 |
number
76 |
Optional
77 |
The barrier at which the filter should timeout users, should the filter have one. Only can be used with filters supporting a limit.
78 |
79 |
80 |
message
81 |
string
82 |
Optional
83 |
The timeout message given to a user when they are timed out (if filter is not silenced). If empty string, defaults to Duke Nukem quotes.
84 |
85 |
86 |
silent
87 |
boolean
88 |
Optional
89 |
If true, the filter will not emit a message to chat telling to user why they were timed out. If false, the filter is will emit a message.
90 |
91 |
92 |
whitelist
93 |
string
94 |
Optional
95 |
New-line delimited list of whitelisted phrases. For the link whitelist this parses hostnames (like `youtube.com` unless wildcards or regex is used). Wildcards can be used (`*`). RegEx is also supported (`~/[pattern]/[flags]`). Only can be used with filters supporting a whitelist.
The status of the timer. A value of true means the timer is enabled, while false means the timer is disabled and will not execute.
30 |
31 |
32 |
interval
33 |
string
34 |
The timer interval in cron syntax. Minimum interval is once per 5 minutes.
35 |
36 |
37 |
lines
38 |
number
39 |
This is the minimum amount of chat lines per 5 minutes required to activate the timer. This is useful in slow chats to prevent Nightbot from spamming in an empty channel.
40 |
41 |
42 |
message
43 |
string
44 |
The message Nightbot sends to chat when the command is called. It can contain variables for extra functionality.
45 |
46 |
47 |
name
48 |
string
49 |
The timer name (has no real significance but gives you a quick reference to what the timer does)
The status of the timer. A value of true means the timer is enabled, while false means the timer is disabled and will not execute.
56 |
57 |
58 |
interval
59 |
string
60 |
Required
61 |
The timer interval in cron syntax. Minimum interval is once per 5 minutes.
62 |
63 |
64 |
lines
65 |
number
66 |
Required
67 |
This is the minimum amount of chat lines per 5 minutes required to activate the timer. This is useful in slow chats to prevent Nightbot from spamming in an empty channel.
68 |
69 |
70 |
message
71 |
string
72 |
Required
73 |
The message to send to chat. It can contain variables for extra functionality. Maximum length: 400 characters
74 |
75 |
76 |
name
77 |
string
78 |
Required
79 |
The timer name (has no real significance but gives you a quick reference to what the timer does)
80 |
81 |
82 |
--------------------------------------------------------------------------------
/includes/timers/_put_id.md:
--------------------------------------------------------------------------------
1 | ## Edit timer by id
2 |
3 | ```cURL
4 | curl -X PUT "https://api.nightbot.tv/1/timers/568a02834184d1a07660f380" \
5 | -H "Authorization: Bearer 4fb1fed8889ec9d1c319d5b3c9a54b23" \
6 | -d "name=testing"
7 |
8 | {
9 | "status": 200,
10 | "timer": {
11 | "createdAt": "2016-01-04T05:26:27.593Z",
12 | "updatedAt": "2016-01-04T05:26:27.593Z",
13 | "name": "testing",
14 | "message": "test message",
15 | "_id": "568a02834184d1a07660f380",
16 | "interval": "*/15 * * * *",
17 | "nextRunAt": "1970-01-01T00:00:00.000Z",
18 | "lines": 2,
19 | "enabled": true
20 | }
21 | }
22 | ```
23 |
24 | Edits a timer by its id.
25 |
26 | **HTTP Request**
27 |
28 | `PUT https://api.nightbot.tv/1/timers/:id`
29 |
30 | **Scope**
31 |
32 | `timers`
33 |
34 | **Body Parameters**
35 |
36 | The following parameters can be sent as a URL encoded string or JSON (using the appropriate `Content-Type` header). `PUT` requests usually require the entire model to be included in the request, but we allow partial updates.
37 |
38 |
39 |
40 |
41 |
Parameter
42 |
Type
43 |
Required
44 |
Description
45 |
46 |
47 |
48 |
49 |
enabled
50 |
boolean
51 |
Optional
52 |
The status of the timer. A value of true means the timer is enabled, while false means the timer is disabled and will not execute.
53 |
54 |
55 |
interval
56 |
string
57 |
Optional
58 |
The timer interval in cron syntax. Minimum interval is once per 5 minutes.
59 |
60 |
61 |
lines
62 |
number
63 |
Optional
64 |
This is the minimum amount of chat lines per 5 minutes required to activate the timer. This is useful in slow chats to prevent Nightbot from spamming in an empty channel.
65 |
66 |
67 |
message
68 |
string
69 |
Optional
70 |
The message to send to chat. It can contain variables for extra functionality. Maximum length: 400 characters
71 |
72 |
73 |
name
74 |
string
75 |
Optional
76 |
The timer name (has no real significance but gives you a quick reference to what the timer does)