diff --git a/bin/cozybot.dart b/bin/cozybot.dart index 6bc14e0..8e3a755 100644 --- a/bin/cozybot.dart +++ b/bin/cozybot.dart @@ -8,6 +8,7 @@ import "package:shelf_router/shelf_router.dart"; void main(List argsRaw) async { final container = ProviderContainer(); + final isDebug = true; final handler = const Pipeline() .addMiddleware(logRequests()) @@ -53,13 +54,15 @@ void main(List argsRaw) async { ); final server = HttpServer.listenOn( - await ServerSocket.bind( - InternetAddress( - "/var/run/cozybot/socket", - type: InternetAddressType.unix, - ), - 0, - ), + isDebug + ? await ServerSocket.bind(InternetAddress.loopbackIPv4, 8080) + : await ServerSocket.bind( + InternetAddress( + "/var/run/cozybot/socket", + type: InternetAddressType.unix, + ), + 0, + ), ); serveRequests(server, handler); diff --git a/lib/controllers/record_controller.dart b/lib/controllers/record_controller.dart index 7491dfe..9f2b6af 100644 --- a/lib/controllers/record_controller.dart +++ b/lib/controllers/record_controller.dart @@ -10,7 +10,7 @@ class RecordController extends Notifier { message, _, ) { - if (userstate.username == "Streamlabs") { + if (userstate["username"] == "streamlabs") { final match = RegExp( r"\d+[Ww]?-\d+[Ll]?", ).allMatches(message).lastOrNull;