<commit_before>import logging

import datetime

from pajbot import utils
from pajbot.apiwrappers.dubtrack import DubtrackAPI
from pajbot.managers.handler import HandlerManager
from pajbot.managers.redis import RedisManager
from pajbot.managers.schedule import ScheduleManager
from pajbot.models.command import Command
from pajbot.models.command import CommandExample
from pajbot.modules import BaseModule
from pajbot.modules import ModuleSetting

log = logging.getLogger(__name__)


class DubtrackSongInfo:
    """Holds only the info relevant for displaying the song in chat."""

    def __init__(self, song_id, song_name, song_link, requester_name):
        self.song_id = song_id
        self.song_name = song_name
        self.song_link = song_link
        self.requester_name = requester_name


class DubtrackModule(BaseModule):
    AUTHOR = "TalVivian @ github.com/TalVivian"
    ID = __name__.split(".")[-1]
    NAME = "Dubtrack"
    DESCRIPTION = "Gets currently playing song from dubtrack"
    CATEGORY = "Feature"
    SETTINGS = [
        ModuleSetting(
            key="room_name",
            label="Dubtrack room name",
            type="text",
            required=True,
            placeholder="Dubtrack room name (i.e. pajlada)",
            default="pajlada",
            constraints={"min_str_len": 1, "max_str_len": 70},
        ),
        ModuleSetting(
            key="phrase_room_link",
            label="Room link message | Available arguments: {room_name}",
            type="text",
            required=True,
            placeholder="Request your songs at https://dubtrack.fm/join/{room_name}",
            default="Request your songs at https://dubtrack.fm/join/{room_name}",
            constraints={"min_str_len": 1, "max_str_len": 400},
        ),
        ModuleSetting(
            key="phrase_current_song",
            label="Current song message | Available arguments: {song_name}, {song_link}, {requester_name}",
            type="text",
            required=True,
            placeholder="Current song: {song_name}, link: {song_link} requested by {requester_name}",
            default="Current song: {song_name}, link: {song_link} requested by {requester_name}",
            constraints={"min_str_len": 1, "max_str_len": 400},
        ),
        ModuleSetting(
            key="phrase_no_current_song",<commit_msg>update dubtrack room label to hint towards spaces not being allowed (#663)<commit_after>import logging

import datetime

from pajbot import utils
from pajbot.apiwrappers.dubtrack import DubtrackAPI
from pajbot.managers.handler import HandlerManager
from pajbot.managers.redis import RedisManager
from pajbot.managers.schedule import ScheduleManager
from pajbot.models.command import Command
from pajbot.models.command import CommandExample
from pajbot.modules import BaseModule
from pajbot.modules import ModuleSetting

log = logging.getLogger(__name__)


class DubtrackSongInfo:
    """Holds only the info relevant for displaying the song in chat."""

    def __init__(self, song_id, song_name, song_link, requester_name):
        self.song_id = song_id
        self.song_name = song_name
        self.song_link = song_link
        self.requester_name = requester_name


class DubtrackModule(BaseModule):
    AUTHOR = "TalVivian @ github.com/TalVivian"
    ID = __name__.split(".")[-1]
    NAME = "Dubtrack"
    DESCRIPTION = "Gets currently playing song from dubtrack"
    CATEGORY = "Feature"
    SETTINGS = [
        ModuleSetting(
            key="room_name",
            label="Dubtrack room name. No spaces. Use the string after /join/ in the URL",
            type="text",
            required=True,
            placeholder="Dubtrack room name (i.e. pajlada)",
            default="pajlada",
            constraints={"min_str_len": 1, "max_str_len": 70},
        ),
        ModuleSetting(
            key="phrase_room_link",
            label="Room link message | Available arguments: {room_name}",
            type="text",
            required=True,
            placeholder="Request your songs at https://dubtrack.fm/join/{room_name}",
            default="Request your songs at https://dubtrack.fm/join/{room_name}",
            constraints={"min_str_len": 1, "max_str_len": 400},
        ),
        ModuleSetting(
            key="phrase_current_song",
            label="Current song message | Available arguments: {song_name}, {song_link}, {requester_name}",
            type="text",
            required=True,
            placeholder="Current song: {song_name}, link: {song_link} requested by {requester_name}",
            default="Current song: {song_name}, link: {song_link} requested by {requester_name}",
            constraints={"min_str_len": 1, "max_str_len": 400},
        ),
        ModuleSetting(
            key="phrase_no_current_song",
{'fraction_non_alphanumeric': 0.10074781886165352, 'fraction_numerical': 0.005608641462401329, 'mean_word_length': 2.870578778135048, 'pattern_counts': {'":': 12, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '328439', 'n_tokens_mistral': 1428, 'n_tokens_neox': 1363, 'n_words': 346}