Skip to content

Commit

Permalink
removed siege mode
Browse files Browse the repository at this point in the history
  • Loading branch information
clragon committed Apr 26, 2024
1 parent 33e8614 commit 3ee3c50
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 359 deletions.
2 changes: 0 additions & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:nyxx/nyxx.dart';
import 'package:swan/plugins/anti_siege/plugin.dart';
import 'package:swan/plugins/anti_spam/plugin.dart';
import 'package:swan/plugins/dartdoc/plugin.dart';
import 'package:swan/plugins/database/database.dart';
Expand Down Expand Up @@ -35,7 +34,6 @@ Future<void> main() async {
PasteFiles(),
DartdocSearch(),
AntiSpam(),
AntiSiege(),
],
),
);
Expand Down
150 changes: 0 additions & 150 deletions lib/plugins/anti_siege/plugin.dart

This file was deleted.

29 changes: 1 addition & 28 deletions lib/plugins/database/database.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'package:drift/native.dart';

part 'database.g.dart';

@DriftDatabase(tables: [AntiSpamConfigs, AntiSiegeConfigs])
@DriftDatabase(tables: [AntiSpamConfigs])
class SwanDatabase extends _$SwanDatabase {
SwanDatabase()
: super(
Expand All @@ -15,15 +15,6 @@ class SwanDatabase extends _$SwanDatabase {
@override
int get schemaVersion => 2;

@override
MigrationStrategy get migration => MigrationStrategy(
onUpgrade: (migrator, from, to) async {
if (from == 1) {
await migrator.createTable(antiSiegeConfigs);
}
},
);

Stream<AntiSpamConfig?> antiSpamConfig(int id) =>
(select(antiSpamConfigs)..where((tbl) => tbl.guildId.equals(id)))
.watchSingleOrNull();
Expand All @@ -33,16 +24,6 @@ class SwanDatabase extends _$SwanDatabase {

Future<void> deleteAntiSpamConfig(int id) =>
(delete(antiSpamConfigs)..where((tbl) => tbl.guildId.equals(id))).go();

Stream<AntiSiegeConfig?> antiSiegeConfig(int id) =>
(select(antiSiegeConfigs)..where((tbl) => tbl.guildId.equals(id)))
.watchSingleOrNull();

Future<void> setAntiSiegeConfig(AntiSiegeConfigsCompanion config) =>
into(antiSiegeConfigs).insertOnConflictUpdate(config);

Future<void> deleteAntiSiegeConfig(int id) =>
(delete(antiSiegeConfigs)..where((tbl) => tbl.guildId.equals(id))).go();
}

class AntiSpamConfigs extends Table {
Expand All @@ -53,11 +34,3 @@ class AntiSpamConfigs extends Table {
IntColumn get warningChannelId => integer()();
IntColumn get rulesChannelId => integer()();
}

class AntiSiegeConfigs extends Table {
@override
Set<Column> get primaryKey => {guildId};

IntColumn get guildId => integer()();
IntColumn get logChannelId => integer()();
}
Loading

0 comments on commit 3ee3c50

Please sign in to comment.