Allow announcement channels for panels
This commit is contained in:
parent
227049ef4d
commit
19826368ff
@ -163,7 +163,7 @@ func (d *multiPanelCreateData) validateChannel(guildId uint64) func() error {
|
||||
|
||||
var valid bool
|
||||
for _, ch := range channels {
|
||||
if ch.Id == d.ChannelId && ch.Type == channel.ChannelTypeGuildText {
|
||||
if ch.Id == d.ChannelId && (ch.Type == channel.ChannelTypeGuildText || ch.Type == channel.ChannelTypeGuildNews) {
|
||||
valid = true
|
||||
break
|
||||
}
|
||||
|
@ -370,7 +370,7 @@ func (p *panelBody) getEmoji() *emoji.Emoji {
|
||||
func (p *panelBody) verifyChannel(channels []channel.Channel) bool {
|
||||
var valid bool
|
||||
for _, ch := range channels {
|
||||
if ch.Id == p.ChannelId && ch.Type == channel.ChannelTypeGuildText {
|
||||
if ch.Id == p.ChannelId && (ch.Type == channel.ChannelTypeGuildText || ch.Type == channel.ChannelTypeGuildNews) {
|
||||
valid = true
|
||||
break
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
</option>
|
||||
{/if}
|
||||
{#each channels as channel}
|
||||
{#if channel.type === 0}
|
||||
{#if channel.type === 0 || (allowAnnouncementChannel && channel.type === 5)}
|
||||
<option value="{channel.id}">
|
||||
#{channel.name}
|
||||
</option>
|
||||
@ -21,6 +21,7 @@
|
||||
export let channels = [];
|
||||
export let withNull = false;
|
||||
export let nullLabel = "Disabled";
|
||||
export let allowAnnouncementChannel = false;
|
||||
|
||||
$: value, ensureStringified();
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
<Colour col1={true} label="Panel Colour" on:change={updateColour} bind:value={tempColour}/>
|
||||
</div>
|
||||
<div class="col-2-3">
|
||||
<ChannelDropdown col1={true} {channels} label="Panel Channel" bind:value={data.channel_id}/>
|
||||
<ChannelDropdown col1 allowAnnouncementChannel {channels} label="Panel Channel" bind:value={data.channel_id}/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
@ -16,8 +16,8 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<Colour col4=true label="Panel Colour" on:change={updateColour} bind:value={tempColour}/>
|
||||
<ChannelDropdown label="Panel Channel" col4=true {channels} bind:value={data.channel_id}/>
|
||||
<CategoryDropdown label="Ticket Category" col4=true {channels} bind:value={data.category_id}/>
|
||||
<ChannelDropdown label="Panel Channel" allowAnnouncementChannel col4 {channels} bind:value={data.channel_id}/>
|
||||
<CategoryDropdown label="Ticket Category" col4 {channels} bind:value={data.category_id}/>
|
||||
<Dropdown col4=true label="Form" bind:value={data.form_id}>
|
||||
<option value=null>None</option>
|
||||
{#each forms as form}
|
||||
@ -314,7 +314,7 @@
|
||||
teams: [],
|
||||
button_style: "1",
|
||||
form_id: "null",
|
||||
channel_id: channels.find((c) => c.type === 0)?.id,
|
||||
channel_id: channels.find((c) => c.type === 0 || c.type === 5)?.id,
|
||||
category_id: channels.find((c) => c.type === 4)?.id,
|
||||
use_server_default_naming_scheme: true,
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user