Skip to content
This repository was archived by the owner on Jun 9, 2024. It is now read-only.

Commit 72196f1

Browse files
committed
feature: Initial text-in-voice implementation
1 parent 5b892ef commit 72196f1

File tree

4 files changed

+36
-2
lines changed

4 files changed

+36
-2
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@
158158
<groupId>ch.qos.logback</groupId>
159159
<artifactId>logback-classic</artifactId>
160160
<version>${logback.version}</version>
161-
<scope>test</scope>
161+
<!-- <scope>test</scope>-->
162162
</dependency>
163163

164164
<!-- Deep/recursive field by field comparing ignoring any equals() methods -->

src/main/java/com/mewna/catnip/entity/channel/VoiceChannel.java

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,15 @@
2828
package com.mewna.catnip.entity.channel;
2929

3030
import javax.annotation.CheckReturnValue;
31+
import javax.annotation.Nullable;
3132

3233
/**
3334
* A voice channel in a guild.
3435
*
3536
* @author natanbc
3637
* @since 9/12/18
3738
*/
38-
public interface VoiceChannel extends GuildChannel {
39+
public interface VoiceChannel extends TextChannel {
3940
/**
4041
* @return The bitrate of this channel. Will be from 8 to 96.
4142
*/
@@ -76,4 +77,27 @@ default boolean isVoice() {
7677
default boolean isCategory() {
7778
return false;
7879
}
80+
81+
/**
82+
* Voice channels will never have a topic.
83+
*
84+
* @return {@code null}
85+
*/
86+
@Nullable
87+
@Override
88+
default String topic() {
89+
return null;
90+
}
91+
92+
@Override
93+
default boolean nsfw() {
94+
// TODO: Wait for confirmation from maxg about this flag, currently TBD
95+
return false;
96+
}
97+
98+
@Override
99+
default int rateLimitPerUser() {
100+
// TODO: Wait for confirmation from maxg about this, currently TBD
101+
return 0;
102+
}
79103
}

src/main/java/com/mewna/catnip/entity/guild/GuildFeature.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ public enum GuildFeature {
142142
* See https://github.com/mewna/catnip/issues/613.
143143
*/
144144
ANIMATED_BANNER,
145+
MEMBER_PROFILES,
146+
TEXT_IN_VOICE_ENABLED,
147+
PREMIUM_TIER_3_OVERRIDE,
145148
/**
146149
* When no other feature matches.
147150
*/

src/main/java/com/mewna/catnip/entity/impl/channel/VoiceChannelImpl.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import lombok.experimental.Accessors;
3636

3737
import javax.annotation.Nonnull;
38+
import javax.annotation.Nullable;
3839
import java.util.List;
3940

4041
/**
@@ -85,4 +86,10 @@ public boolean equals(final Object obj) {
8586
public String toString() {
8687
return String.format("VoiceChannel (%s)", name);
8788
}
89+
90+
@Nullable
91+
@Override
92+
public String topic() {
93+
return null;
94+
}
8895
}

0 commit comments

Comments
 (0)