This repository has been archived by the owner on Jan 6, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.gql
330 lines (267 loc) · 9.23 KB
/
schema.gql
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
# List of queries available in api.nino.sh
type Query {
#punishments(guild: String!): [Punishment!]!
#warnings(guild: String!): [Warning!]!
#warning(guild: String!, user: String!): [Warning!]!
#blacklist(id: String!): Blacklist
#logging(id: String!): Logging
automod(id: String!): Automod
guild(id: String!): Guild
#cases(guild: String!): [Case!]!
#case(guild: String!, id: Int!): Case
user(id: String!): User
me: LoggedInUser
}
# List of mutations available in api.nino.sh
# Note that all mutations require authentication or it'll fail.
type Mutation {
#removeIgnoreUser(guild: String!, id: String!): Boolean!
#addIgnoreUser(guild: String!, id: String!): Boolean!
#removeIgnoreChannel(guild: String!, id: String!): Boolean!
#addIgnoreChannel(guild: String!, id: String!): Boolean!
#toggleLoggingEvent(id: String!, event: LoggingEvent!): Boolean!
#addPunishment(punishment: AddPunishmentMetadata!): Punishment!
#updateLogging(metadata: UpdateLoggingMetadata!): Boolean!
#addBlacklist(blacklist: AddBlacklistMetadata!): Blacklist!
#removeBlacklist(id: String!): Blacklist!
#addWarning(warning: AddWarningMetadata!): Warning!
#toggleShortlinks(id: String!): Boolean!
#toggleBlacklist(id: String!): Boolean!
#toggleMentions(id: String!): Boolean!
#toggleLogging(id: String!): Boolean!
#toggleInvites(id: String!): Boolean!
#toggleDehoist(id: String!): Boolean!
#toggleSpam(id: String!): Boolean!
#toggleRaid(id: String!): Boolean!
updateGuildLanguage(id: String!, language: String!): Boolean!
updateUserLanguage(id: String!, language: String!): Boolean!
removeGuildPrefix(id: String!, prefix: String!): Boolean!
addGuildPrefix(id: String!, prefix: String!): Boolean!
removeUserPrefix(id: String!, prefix: String!): Boolean!
addUserPrefix(id: String!, prefix: String!): Boolean!
updateModLog(id: String!, modlogID: String): Boolean!
updateMutedRole(id: String!, roleID: String): Boolean!
login(accessToken: String!): String
logout: Boolean!
}
# Defines a guild in the database
type Guild {
# The mod log channel ID, `null` if none is set
modlogChannelID: String
# The muted role ID, `null` if none is set
mutedRoleID: String
# A list of the guild's prefixes
prefixes: [String!]!
# The language the guild has set, it'll use that locale in the dashboard
# instead of the user's locale unless the guild's locale is en_US
language: String!
# Returns the guild's ID, this isn't needed in any practical application.
id: String!
}
# Represents a object of a guild's automod features
# This doesn't include the blacklisted words, if any.
type Automod {
# Returns a list of channel IDs that are excluded
# in raids. Read more here: https://nino.sh/docs/automod#raid
whitelistChannels: [String!]!
# If the shortlinks automod feature is enabled,
# read more here: https://nino.sh/docs/automod#shortlinks
shortLinks: Boolean!
# If the blacklist / swears automod feature is enabled,
# read more here: https://nino.sh/docs/automod#blacklist
blacklist: Boolean!
# The guild's ID in which this automod entry belongs to.
guildId: String!
# If the mentions automod feature is enabled,
# read more here: https://nino.sh/docs/automod#mentions
mentions: Boolean!
# If the invites automod feature is enabled,
# read more here: https://nino.sh/docs/automod#invites
invites: Boolean!
# If the dehoist automod feature is enabled,
# read more here: https://nino.sh/docs/automod#dehoisting
dehoist: Boolean!
# If the spam automod feature is enabled,
# read more here: https://nino.sh/docs/automod#spam
spam: Boolean!
# If the raid automod feature is enabled,
# read more here: https://nino.sh/docs/automod#raid
raid: Boolean!
}
# Represents the type the blacklist is handled by
enum BlacklistType {
GUILD
USER
}
# Represents a blacklist in the database, this guild or user
# cannot use any of Nino's features and will proceed to leave the
# guild if a command is executed.
type Blacklist {
# The reason of why the blacklist was created
reason: String
# The developer who issued the blacklist
issuer: String!
# The type of the blacklist
type: BlacklistType!
}
# Represents a mod-log case that has been committed by Nino.
type Case {
# A list of attachments provided by the moderator
# on why the user was banned/kicked/etc
attachments: [String!]!
# The moderator's ID
moderatorID: String!
# The message ID in the mod-log available
# This can return `null` if no mod-log was set.
messageID: String
# The victim's ID who committed this offense.
victimID: String!
# The reason on why the offense was took into action.
# This can return `null` if the reason was not provided.
reason: String
# The punishment that is linked to this case
type: PunishmentType!
# If the punishment was a soft-ban or not
soft: Boolean!
# The time in milliseconds that this ban/mute/warn will expire.
# This can return `null` if no timestamp was provided.
time: Int
}
# Represents a logging event that can occur
enum LoggingEvent {
VOICE_MEMBER_DEAFENED
VOICE_CHANNEL_SWITCH
VOICE_MEMBER_MUTED
VOICE_CHANNEL_LEFT
VOICE_CHANNEL_JOIN
MESSAGE_UPDATE
MESSAGE_DELETE
}
# Represents a guild's logging features
type Logging {
# A list of ignored channels to skip when logging.
ignoreChannels: [String!]!
# A list of ignored users to skip when logging.
ignoreUsers: [String!]!
# The logging channel, if any.
# This can return `null` if no logging channel was set.
channelID: String
# If the logging feature is enabled in this guild
enabled: Boolean!
# Any logging events that are enabled.
# This returns an empty array if no events are enabled.
events: [LoggingEvent!]!
}
# Represents the punishment that was committed
enum PunishmentType {
WARNING_REMOVED
VOICE_UNDEAFEN
WARNING_ADDED
VOICE_UNMUTE
VOICE_DEAFEN
VOICE_MUTE
UNMUTE
UNBAN
KICK
MUTE
BAN
}
# Represents a guild's punishments
type Punishment {
# How many warnings before we have to punish a user for.
warnings: Int!
# The punishment index, for easy removal and updating.
index: Int!
# If the `type` is referred to a PunishmentType.Ban,
# this will return `true` or `false`. Otherwise,
# this will always be false.
soft: Boolean!
# The amount of time to remove the punishment
# off a user from.
time: Int
# The punishment type
type: PunishmentType!
}
# Represents a user in the database
type User {
# The user's language that they set using the `locale` command.
# This will be also the user's language set on the site.
language: String!
# The user's prefixes, if any.
prefixes: [String!]!
# The user's ID
id: String!
}
# Represents a user warning in the database
type Warning {
# The guild this warning was committed on.
guildID: String!
# The reason of why this warning was issued.
reason: String
# The amount of warnings that the moderator added
amount: Int!
# The user who has this warning attached
userID: String!
}
# Represents a input type for the `addPunishment` mutation
input AddPunishmentMetadata {
# How many warnings before we have to punish a user for.
warnings: Int!
# If the `type` is referred to a PunishmentType.Ban,
# this will return `true` or `false`. Otherwise,
# this will always be false.
soft: Boolean!
# The amount of time to remove the punishment
# off a user from.
time: Int
# The punishment type
type: PunishmentType!
# The guild ID
id: String!
}
# Represents a input type for the `addWarning` mutation
input AddWarningMetadata {
# The reason of why this warning was issued.
reason: String
# The amount of warnings that the moderator added
amount: Int!
# The victim to add the warning to
victim: String!
# The guild ID
id: String!
}
# Represents a input type for the `updateLogging` mutation
input UpdateLoggingMetadata {
# The logging channel, if any.
# This can return `null` if no logging channel was set.
channelID: String
# The guild ID
id: String!
}
# Represents a input type for the `addBlacklist` mutation
input AddBlacklistMetadata {
# The reason of why the blacklist was created
reason: String
# The developer who issued the blacklist
issuer: String!
# The type of the blacklist
type: BlacklistType!
# The ID this blacklist belongs to
id: String!
}
type LoggedInUser {
discriminator: String!
username: String!
avatar: String
guilds: [PartialGuild!]!
entry: User!
id: String!
}
type PartialGuild {
permissions: String!
features: [String!]!
owner: Boolean!
icon: String
name: String!
id: String!
}