/
ICopyableChannel.java
103 lines (97 loc) · 4.53 KB
/
ICopyableChannel.java
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
/*
* Copyright 2015 Austin Keener, Michael Ritter, Florian Spieß, and the JDA contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.dv8tion.jda.api.entities;
import net.dv8tion.jda.api.requests.restaction.ChannelAction;
import javax.annotation.CheckReturnValue;
import javax.annotation.Nonnull;
/**
* Represents a GuildChannel that is capable of being copied.
*
* Please see {@link ICopyableChannel#createCopy()} for information on what is copied.
*/
public interface ICopyableChannel extends GuildChannel
{
/**
* Creates a copy of the specified {@link GuildChannel GuildChannel}
* in the specified {@link net.dv8tion.jda.api.entities.Guild Guild}.
* <br>If the provided target guild is not the same Guild this channel is in then
* the parent category and permissions will not be copied due to technical difficulty and ambiguity.
*
* <p>This copies the following elements:
* <ol>
* <li>Name</li>
* <li>Parent Category (if present)</li>
* <li>Voice Elements (Bitrate, Userlimit)</li>
* <li>Text Elements (Topic, NSFW, Slowmode)</li>
* <li>All permission overrides for Members/Roles</li>
* </ol>
*
* <p>Possible {@link net.dv8tion.jda.api.requests.ErrorResponse ErrorResponses} caused by
* the returned {@link net.dv8tion.jda.api.requests.RestAction RestAction} include the following:
* <ul>
* <li>{@link net.dv8tion.jda.api.requests.ErrorResponse#MISSING_PERMISSIONS MISSING_PERMISSIONS}
* <br>The channel could not be created due to a permission discrepancy</li>
*
* <li>{@link net.dv8tion.jda.api.requests.ErrorResponse#MISSING_ACCESS MISSING_ACCESS}
* <br>The {@link net.dv8tion.jda.api.Permission#VIEW_CHANNEL VIEW_CHANNEL} permission was removed</li>
* </ul>
*
* @param guild
* The {@link net.dv8tion.jda.api.entities.Guild Guild} to create the channel in
*
* @throws java.lang.IllegalArgumentException
* If the provided guild is {@code null}
* @throws net.dv8tion.jda.api.exceptions.PermissionException
* If the currently logged in account does not have the {@link net.dv8tion.jda.api.Permission#MANAGE_CHANNEL MANAGE_CHANNEL} Permission
*
* @return A specific {@link ChannelAction ChannelAction}
* <br>This action allows to set fields for the new GuildChannel before creating it!
*/
@Nonnull
@CheckReturnValue
ChannelAction<? extends ICopyableChannel> createCopy(@Nonnull Guild guild);
/**
* Creates a copy of the specified {@link GuildChannel GuildChannel}.
*
* <p>This copies the following elements:
* <ol>
* <li>Name</li>
* <li>Parent Category (if present)</li>
* <li>Voice Elements (Bitrate, Userlimit)</li>
* <li>Text Elements (Topic, NSFW, Slowmode)</li>
* <li>All permission overrides for Members/Roles</li>
* </ol>
*
* <p>Possible {@link net.dv8tion.jda.api.requests.ErrorResponse ErrorResponses} caused by
* the returned {@link net.dv8tion.jda.api.requests.RestAction RestAction} include the following:
* <ul>
* <li>{@link net.dv8tion.jda.api.requests.ErrorResponse#MISSING_PERMISSIONS MISSING_PERMISSIONS}
* <br>The channel could not be created due to a permission discrepancy</li>
*
* <li>{@link net.dv8tion.jda.api.requests.ErrorResponse#MISSING_ACCESS MISSING_ACCESS}
* <br>The {@link net.dv8tion.jda.api.Permission#VIEW_CHANNEL VIEW_CHANNEL} permission was removed</li>
* </ul>
*
* @throws net.dv8tion.jda.api.exceptions.PermissionException
* If the currently logged in account does not have the {@link net.dv8tion.jda.api.Permission#MANAGE_CHANNEL MANAGE_CHANNEL} Permission
*
* @return A specific {@link ChannelAction ChannelAction}
* <br>This action allows to set fields for the new GuildChannel before creating it!
*/
@Nonnull
@CheckReturnValue
ChannelAction<? extends ICopyableChannel> createCopy();
}