private async Task Game_GameStarted(AmongUsGame sender, GameStartAsyncEventArgs e) { if (this.GameManager.VoiceChannel != 0ul) { await this.DiscordBot.MuteAllAsync(this.GameManager.VoiceChannel); } var chn = this.GameManager.TextChannel; if (chn == 0ul) { return; } await this.DiscordBot.SendMessageAsync(chn, $"Game started, map: {e.Map}"); }
private async Task Game_GameStarted(AmongUsGame sender, GameStartAsyncEventArgs e) => await this.Comms.SendEventAsync(new ProbeEvent(ProbeEventType.GameStart, ProbeGameStartEventPayload.FromEventArgs(e)));
/// <summary> /// Creates a payload from event args. /// </summary> /// <param name="e">Event args to construct from.</param> /// <returns>Constructed event payload.</returns> public static ProbeGameStartEventPayload FromEventArgs(GameStartAsyncEventArgs e) => new ProbeGameStartEventPayload { Map = e.Map };