Example #1
0
def notify_camera(rcon: RecordedRcon, struct_log):
    send_to_discord_audit(message=struct_log['message'],
                          by=struct_log['player'])

    try:
        if hooks := get_prepared_discord_hooks("camera"):
            embeded = DiscordEmbed(
                title=
                f'{struct_log["player"]}  - {struct_log["steam_id_64_1"]}',
                description=struct_log["sub_content"],
                color=242424,
            )
            for h in hooks:
                h.add_embed(embeded)
                h.execute()
    except Exception:
        logger.exception("Unable to forward to hooks")

    config = CameraConfig()
    if config.is_broadcast():
        rcon.set_broadcast(struct_log['message'])

    if config.is_welcome():
        rcon.set_welcome_message(struct_log['message'])
Example #2
0
def broadcast(msg):
    from rcon.recorded_commands import RecordedRcon

    rcon = RecordedRcon(SERVER_INFO)
    rcon.set_broadcast(msg)