Discord Bot Changes

- Have added All Profiles Alias global settings
- Have changed the discord bot to handle the All Profile alias to performs commands against all profiles in the channel.
This commit is contained in:
Brett Hewitson 2022-04-14 21:06:14 +10:00
parent fc658b04dd
commit 1aa8d79108
19 changed files with 1227 additions and 1026 deletions

View file

@ -620,22 +620,25 @@
<Button Margin="1" Content="{DynamicResource DiscordBotHelpButtonContent}" Click="DiscordBotHelp_Click"/>
</StackPanel>
<Label Grid.Row="2" Grid.Column="0" Content="{DynamicResource GlobalSettings_DiscordBotServerLabel}" VerticalAlignment="Center"/>
<Label Grid.Row="2" Grid.Column="0" Content="{DynamicResource GlobalSettings_DiscordBotServerLabel}" VerticalAlignment="Top" Margin="0,2,0,0"/>
<TextBox Grid.Row="2" Grid.Column="1" Margin="1" Text="{Binding Config.DiscordBotServerId}" IsReadOnlyCaretVisible="True" VerticalContentAlignment="Center" ToolTip="{DynamicResource GlobalSettings_DiscordBotServerTooltip}"/>
<Label Grid.Row="2" Grid.Column="3" Content="{DynamicResource GlobalSettings_DiscordBotPrefixLabel}" VerticalAlignment="Center"/>
<TextBox Grid.Row="2" Grid.Column="4" Margin="1" Text="{Binding Config.DiscordBotPrefix}" IsReadOnlyCaretVisible="True" VerticalContentAlignment="Center" ToolTip="{DynamicResource GlobalSettings_DiscordBotPrefixTooltip}"/>
<Label Grid.Row="2" Grid.Column="6" Margin="1" Content="{DynamicResource GlobalSettings_DiscordBotLogLevelLabel}" VerticalAlignment="Center"/>
<ComboBox Name="DiscordBotLogLevelComboBox" Grid.Row="2" Grid.Column="7" Margin="1" ItemsSource="{Binding ElementName=GlobalSettings, Path=DiscordBotLogLevels}" SelectedValue="{Binding Config.DiscordBotLogLevel}" SelectedValuePath="ValueMember" DisplayMemberPath="DisplayMember" VerticalContentAlignment="Center" PreviewMouseWheel="ComboBox_PreviewMouseWheel"/>
<CheckBox Grid.Row="3" Grid.Column="1" Margin="0,5,0,0" IsChecked="{Binding Config.AllowDiscordBackup}" Content="{DynamicResource ServerSettings_AllowDiscordBackupLabel}" HorizontalAlignment="Left" ToolTip="{DynamicResource GlobalSettings_DiscordBotAllowBackupTooltip}"/>
<CheckBox Grid.Row="3" Grid.Column="4" Margin="0,5,0,0" IsChecked="{Binding Config.AllowDiscordUpdate}" Content="{DynamicResource ServerSettings_AllowDiscordUpdateLabel}" HorizontalAlignment="Left" ToolTip="{DynamicResource GlobalSettings_DiscordBotAllowUpdateTooltip}"/>
<CheckBox Grid.Row="3" Grid.Column="7" Margin="0,5,0,0" IsChecked="{Binding Config.AllowDiscordStart}" Content="{DynamicResource ServerSettings_AllowDiscordStartLabel}" HorizontalAlignment="Left" ToolTip="{DynamicResource GlobalSettings_DiscordBotAllowStartTooltip}"/>
<Label Grid.Row="3" Grid.Column="0" Content="{DynamicResource GlobalSettings_DiscordBotAllServersKeywordLabel}" VerticalAlignment="Top" Margin="0,2,0,0"/>
<TextBox Grid.Row="3" Grid.Column="1" Margin="1" Text="{Binding Config.DiscordBotAllServersKeyword}" IsReadOnlyCaretVisible="True" VerticalContentAlignment="Center" ToolTip="{DynamicResource GlobalSettings_DiscordBotAllServersKeywordTooltip}"/>
<CheckBox Grid.Row="4" Grid.Column="1" Margin="0,5,0,5" IsChecked="{Binding Config.AllowDiscordRestart}" Content="{DynamicResource ServerSettings_AllowDiscordRestartLabel}" HorizontalAlignment="Left" ToolTip="{DynamicResource GlobalSettings_DiscordBotAllowRestartTooltip}"/>
<CheckBox Grid.Row="4" Grid.Column="4" Margin="0,5,0,5" IsChecked="{Binding Config.AllowDiscordShutdown}" Content="{DynamicResource ServerSettings_AllowDiscordShutdownLabel}" HorizontalAlignment="Left" ToolTip="{DynamicResource GlobalSettings_DiscordBotAllowShutdownTooltip}"/>
<CheckBox Grid.Row="4" Grid.Column="7" Margin="0,5,0,5" IsChecked="{Binding Config.AllowDiscordStop}" Content="{DynamicResource ServerSettings_AllowDiscordStopLabel}" HorizontalAlignment="Left" ToolTip="{DynamicResource GlobalSettings_DiscordBotAllowStopTooltip}"/>
<CheckBox Grid.Row="4" Grid.Column="1" Margin="0,5,0,0" IsChecked="{Binding Config.AllowDiscordBackup}" Content="{DynamicResource ServerSettings_AllowDiscordBackupLabel}" HorizontalAlignment="Left" ToolTip="{DynamicResource GlobalSettings_DiscordBotAllowBackupTooltip}"/>
<CheckBox Grid.Row="4" Grid.Column="4" Margin="0,5,0,0" IsChecked="{Binding Config.AllowDiscordUpdate}" Content="{DynamicResource ServerSettings_AllowDiscordUpdateLabel}" HorizontalAlignment="Left" ToolTip="{DynamicResource GlobalSettings_DiscordBotAllowUpdateTooltip}"/>
<CheckBox Grid.Row="4" Grid.Column="7" Margin="0,5,0,0" IsChecked="{Binding Config.AllowDiscordStart}" Content="{DynamicResource ServerSettings_AllowDiscordStartLabel}" HorizontalAlignment="Left" ToolTip="{DynamicResource GlobalSettings_DiscordBotAllowStartTooltip}"/>
<GroupBox Grid.Row="5" Grid.Column="3" Grid.RowSpan="3" Grid.ColumnSpan="3" HorizontalAlignment="Stretch" MinHeight="200" IsEnabled="{Binding Config.DiscordBotAllowAllBots, Converter={StaticResource InvertBooleanConverter}}">
<CheckBox Grid.Row="5" Grid.Column="1" Margin="0,5,0,5" IsChecked="{Binding Config.AllowDiscordRestart}" Content="{DynamicResource ServerSettings_AllowDiscordRestartLabel}" HorizontalAlignment="Left" ToolTip="{DynamicResource GlobalSettings_DiscordBotAllowRestartTooltip}"/>
<CheckBox Grid.Row="5" Grid.Column="4" Margin="0,5,0,5" IsChecked="{Binding Config.AllowDiscordShutdown}" Content="{DynamicResource ServerSettings_AllowDiscordShutdownLabel}" HorizontalAlignment="Left" ToolTip="{DynamicResource GlobalSettings_DiscordBotAllowShutdownTooltip}"/>
<CheckBox Grid.Row="5" Grid.Column="7" Margin="0,5,0,5" IsChecked="{Binding Config.AllowDiscordStop}" Content="{DynamicResource ServerSettings_AllowDiscordStopLabel}" HorizontalAlignment="Left" ToolTip="{DynamicResource GlobalSettings_DiscordBotAllowStopTooltip}"/>
<GroupBox Grid.Row="6" Grid.Column="3" Grid.RowSpan="3" Grid.ColumnSpan="3" HorizontalAlignment="Stretch" MinHeight="200" IsEnabled="{Binding Config.DiscordBotAllowAllBots, Converter={StaticResource InvertBooleanConverter}}">
<GroupBox.Header>
<StackPanel Orientation="Horizontal">
<Label Content="{DynamicResource GlobalSettings_DiscordBotWhitelistLabel}"/>
@ -684,7 +687,7 @@
</DataGrid>
</GroupBox>
<CheckBox Grid.Row="6" Grid.Column="1" Margin="0,5,0,5" IsChecked="{Binding Config.DiscordBotAllowAllBots}" Content="{DynamicResource ServerSettings_DiscordBotAllowAllBotsLabel}" HorizontalAlignment="Left" ToolTip="{DynamicResource ServerSettings_DiscordBotAllowAllBotsTooltip}"/>
<CheckBox Grid.Row="7" Grid.Column="1" Margin="0,5,0,5" IsChecked="{Binding Config.DiscordBotAllowAllBots}" Content="{DynamicResource ServerSettings_DiscordBotAllowAllBotsLabel}" HorizontalAlignment="Left" ToolTip="{DynamicResource ServerSettings_DiscordBotAllowAllBotsTooltip}"/>
</Grid>
</GroupBox>

View file

@ -2028,7 +2028,7 @@
<cctl:AnnotatedSlider Margin="1" Label="{DynamicResource ServerSettings_GlobalPoweredBatteryDurabilityDecreasePerSecondLabel}" Value="{Binding GlobalPoweredBatteryDurabilityDecreasePerSecond}" Suffix="{DynamicResource SliderUnits_Multiplier}" Minimum="0" Maximum="100" SmallChange="1" LargeChange="10" TickFrequency="1" ToolTip="{DynamicResource ServerSettings_GlobalPoweredBatteryDurabilityDecreasePerSecondTooltip}" />
<cctl:AnnotatedSlider Margin="1" Label="{DynamicResource ServerSettings_FuelConsumptionIntervalMultiplierLabel}" Value="{Binding FuelConsumptionIntervalMultiplier}" Suffix="{DynamicResource SliderUnits_Multiplier}" Minimum="0" Maximum="100" SmallChange="1" LargeChange="10" TickFrequency="1" ToolTip="{DynamicResource ServerSettings_FuelConsumptionIntervalMultiplierTooltip}" />
<cctl:AnnotatedSlider Margin="1" Label="{DynamicResource ServerSettings_LimitNonPlayerDroppedItemsRangeLabel}" Value="{Binding LimitNonPlayerDroppedItemsRange}" Suffix="{DynamicResource SliderUnits_Items}" Minimum="0" Maximum="5000" SmallChange="1" LargeChange="10" TickFrequency="50" ToolTip="{DynamicResource ServerSettings_LimitNonPlayerDroppedItemsRangeTooltip}"/>
<cctl:AnnotatedSlider Margin="1" Label="{DynamicResource ServerSettings_LimitNonPlayerDroppedItemsRangeLabel}" Value="{Binding LimitNonPlayerDroppedItemsRange}" Suffix="{DynamicResource SliderUnits_Units}" Minimum="0" Maximum="5000" SmallChange="1" LargeChange="10" TickFrequency="50" ToolTip="{DynamicResource ServerSettings_LimitNonPlayerDroppedItemsRangeTooltip}"/>
<cctl:AnnotatedSlider Margin="1" Label="{DynamicResource ServerSettings_LimitNonPlayerDroppedItemsCountLabel}" Value="{Binding LimitNonPlayerDroppedItemsCount}" Suffix="{DynamicResource SliderUnits_Items}" Minimum="0" Maximum="5000" SmallChange="1" LargeChange="10" TickFrequency="50" ToolTip="{DynamicResource ServerSettings_LimitNonPlayerDroppedItemsCountTooltip}"/>
<GroupBox Style="{StaticResource GroupBoxStyle}">