public async Task SubscribeToServer(string serverName, int port) { var server = await serverService.Get(Context.Guild.Id, serverName); if (server == null) { await ReplyAsync("Server does not exist!"); return; } if (await SubscribedServerService.Exists(Context.Guild.Id, server.ServerName, Context.Channel.Id)) { await ReplyAsync("Server is already registered here!"); return; } if (NetworkPort.IsCorrect(port) == false) { await ReplyAsync("Wrong port!"); return; } await SubscribedServerService.AddServer(Context.Guild.Id, server.ServerName, port, Context.Channel.Id); await ReplyAsync("Done!"); return; }
public async Task SubscribeToServer(string serverName) { var server = await serverService.Get(Context.Guild.Id, serverName); if (server == null) { await ReplyAsync("Server does not exist!"); return; } if (!await SubscribedServerService.Exists(Context.Guild.Id, server.ServerName, Context.Channel.Id)) { await ReplyAsync("Server is not registered here!"); return; } await SubscribedServerService.RemoveServer(Context.Guild.Id, server.ServerName, Context.Channel.Id); await ReplyAsync("Done!"); return; }