Skip to content

Commit e179873

Browse files
authored
Bot Human Links (#3953)
* Basic backend architecture * BE: Disabled bots signup * BE: Disabled bots signup fix * Frontend implementation of bot human links * Backend changes * Extra improvements * Small fix * Added Token Reveal functionality * Adjusted mobile view * Adjusted dark mode * Small fix * Small fix * Added spam detection * Added #create popup shortcut * AIB page changes! * Small fix * Added bot impersonation * Disabled Bot Management settings for bot * Small fix * PR Review Fixes * Adjusted `send_email_async` not to send emails to the empty address * Don't allow secondary bots to post comments * Allow superusers to create >5 bots
1 parent 04b5be5 commit e179873

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1346
-93
lines changed

authentication/serializers.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ class Meta:
2929
"username",
3030
"email",
3131
"password",
32-
"is_bot",
3332
"add_to_project",
3433
"campaign_key",
3534
"campaign_data",

authentication/views/common.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ def signup_api_view(request):
7474
email = serializer.validated_data["email"]
7575
username = serializer.validated_data["username"]
7676
password = serializer.validated_data["password"]
77-
is_bot = serializer.validated_data.get("is_bot", False)
7877

7978
project = serializer.validated_data.get("add_to_project", None)
8079
campaign_key = serializer.validated_data.get("campaign_key", None)
@@ -104,7 +103,7 @@ def signup_api_view(request):
104103
email=email,
105104
password=password,
106105
is_active=is_active,
107-
is_bot=is_bot,
106+
is_bot=False,
108107
language=language,
109108
app_theme=app_theme,
110109
newsletter_optin=newsletter_optin,

comments/services/common.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
)
1616
from django.db.models.functions import Coalesce, Abs
1717
from django.utils import timezone
18-
from rest_framework.exceptions import ValidationError
18+
from rest_framework.exceptions import ValidationError, PermissionDenied
1919

2020
from comments.models import (
2121
ChangedMyMindEntry,
@@ -90,6 +90,9 @@ def create_comment(
9090
if root:
9191
is_private = root.is_private
9292

93+
if not is_private and user.is_bot and not user.is_primary_bot:
94+
raise PermissionDenied("Only your primary bot can post public comments.")
95+
9396
with transaction.atomic():
9497
obj = Comment(
9598
author=user,

front_end/messages/cs.json

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -695,11 +695,8 @@
695695
"FABHeroSubtitle": "Benchmark Series",
696696
"FABHeroDesc": "Benchmarking nejnovějších výsledků v AI předpovídání proti nejlepším lidem na reálných otázkách.",
697697
"FABGettingStarted": "Začínáme",
698-
"FABRegisterBot": "Zaregistrujte svého bota do turnaje",
699698
"FABCreateBot": "Vytvořit účet pro bota",
700-
"FABSeparateBotAccount": "Váš bot potřebuje samostatný účet na Metaculus. Ujistěte se, že jste se odhlásili ze svého hlavního účtu a vraťte se na tuto stránku.",
701699
"FABBotRegistered": "Váš bot byl úspěšně zaregistrován do turnaje.",
702-
"FABShowToken": "Zobrazit můj token",
703700
"FABTournamentPage": "Otázky",
704701
"FABHowItWorks": "Začínáme",
705702
"FABCreateBotAccount": "Vytvořit účet bota",
@@ -1762,5 +1759,30 @@
17621759
"privateNotes": "Soukromé poznámky",
17631760
"justNow": "právě teď",
17641761
"cmmButtonShort": "Mysl",
1762+
"FABRegisterBot": "Zaregistrujte se, abyste přihlásili svého robota do turnaje",
1763+
"FABRegisterBotSecondary": "Svého předpovědního robota vytvoříte po registraci.",
1764+
"FABCreateAccount": "Vytvořit účet",
1765+
"FABCreatePopupDescription": "Vytvořte si osobní účet Metaculus pro účast v turnaji.\nPo registraci budete navedeni k vytvoření svého předpovědního robota z\nNastavení → Moje předpovědní roboty.",
1766+
"FABCreateBotTitle": "Vytvořte svého prvního předpovědního robota",
1767+
"FABCreateBotDescription": "Jakmile je vytvořen, robot bude automaticky registrován do turnaje.",
1768+
"FABShowToken": "Zobrazit token robota",
1769+
"myForecastingBots": "Moje předpovědní roboty",
1770+
"myBots": "Moje roboty",
1771+
"createBot": "Vytvořit robota",
1772+
"myForecastingBotsDisclaimer": "Dlouhé komentáře robotů, které nepřidávají hodnotu, budou považovány za spam a postiženy podle našich pravidel, včetně deaktivace účtu při opakovaných přestupcích. Soukromé komentáře jsou v pořádku v rozumných mezích.",
1773+
"myBotsEmpty": "Ještě nemáte žádné roboty.\n\n Pokud potřebujete pomoc, podívejte se na naši dokumentaci o <link>Jak nastavit roboty</link>.",
1774+
"createBotDescription": "Tím vytvoříte robota propojeného s vaším uživatelem, což vám umožní spravovat jeho nastavení a aktivitu odsud.",
1775+
"botUsername": "Uživatelské jméno robota",
1776+
"botCreated": "Robot vytvořen",
1777+
"botCreatedDescription": "Toto je váš API klíč robota — zkopírujte a uložte ho bezpečně.\nMůžete ho později zobrazit v nastavení předpovědních robotů.",
1778+
"primaryBotEligibleDisclaimer": "Pouze váš první robot má nárok na ceny.",
1779+
"editBotDescription": "Aktualizujte detaily vašeho robota. Veškeré změny se promítnou na jeho profilové stránce.",
1780+
"revealApiKey": "Zobrazit API klíč",
1781+
"hideApiKey": "Skrýt API klíč",
1782+
"accessToken": "Přístupový token",
1783+
"copy": "kopírovat",
1784+
"switchToBotAccount": "Přepnout na účet bota",
1785+
"impersonationBannerText": "Momentálně si prohlížíte Metaculus jako váš bot.",
1786+
"stopImpersonating": "Přepnout zpět na můj účet",
17651787
"othersCount": "Ostatní ({count})"
17661788
}

front_end/messages/en.json

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -938,11 +938,15 @@
938938
"FABHeroSubtitle": "Benchmark Series",
939939
"FABHeroDesc": "Benchmarking the state of the art in AI forecasting against the best humans on real-world questions.",
940940
"FABGettingStarted": "Getting Started",
941-
"FABRegisterBot": "Register your bot for the tournament",
941+
"FABRegisterBot": "Sign up to register your bot for the tournament",
942+
"FABRegisterBotSecondary": "You’ll create your forecasting bot after signing up.",
942943
"FABCreateBot": "Create a Bot Account",
943-
"FABSeparateBotAccount": "Your bot needs a separate Metaculus account. Make sure to log out of your main account and come back to this page.",
944+
"FABCreateAccount": "Create Account",
945+
"FABCreatePopupDescription": "Create a personal Metaculus account to participate in the tournament.\nAfter signing up, you’ll be guided to create your forecasting bot from\nSettings → My Forecasting Bots.",
946+
"FABCreateBotTitle": "Create your first forecasting bot",
947+
"FABCreateBotDescription": "Once created, bot will be automatically registered for the tournament.",
944948
"FABBotRegistered": "Your bot is successfully registered for the tournament.",
945-
"FABShowToken": "Show My Token",
949+
"FABShowToken": "Show Bot Token",
946950
"FABTournamentPage": "The Questions",
947951
"FABReadMore": "Read More",
948952
"FABHowItWorks": "Getting Started",
@@ -1756,5 +1760,23 @@
17561760
"privateNotes": "Private Notes",
17571761
"justNow": "just now",
17581762
"cmmButtonShort": "Mind",
1763+
"myForecastingBots": "My Forecasting Bots",
1764+
"myBots": "My Bots",
1765+
"createBot": "Create Bot",
1766+
"myForecastingBotsDisclaimer": "Long bot comments that don’t add value will be considered spam and dealt with as provisioned in our guidelines, up to and including account deactivation for repeated offenses. Private comments are fine within reasonable limits.",
1767+
"myBotsEmpty": "You don’t have any bots yet.\n\n If you need help, check our documentation on <link>How to Set up Bots</link>.",
1768+
"createBotDescription": "This will create a bot linked to your user, enabling you to manage its settings and activity from here",
1769+
"botUsername": "Bot username",
1770+
"botCreated": "Bot created",
1771+
"botCreatedDescription": "This is your bot’s API key — copy and store it securely.\nYou can reveal it later in the forecasting bots settings.",
1772+
"primaryBotEligibleDisclaimer": "Only your first bot is eligible for prizes.",
1773+
"editBotDescription": "Update your bot’s details. All changes will be reflected on its profile page.",
1774+
"revealApiKey": "Reveal API Key",
1775+
"hideApiKey": "Hide API Key",
1776+
"accessToken": "Access Token",
1777+
"copy": "Copy",
1778+
"switchToBotAccount": "Switch to Bot Account",
1779+
"impersonationBannerText": "You are currently viewing Metaculus as your bot.",
1780+
"stopImpersonating": "Switch back to my account",
17591781
"none": "none"
17601782
}

front_end/messages/es.json

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -697,11 +697,8 @@
697697
"FABHeroSubtitle": "Serie de Referencia",
698698
"FABHeroDesc": "Comparando el estado del arte en pronósticos de IA con los mejores humanos en preguntas del mundo real.",
699699
"FABGettingStarted": "Comenzar",
700-
"FABRegisterBot": "Registra tu bot en el torneo",
701700
"FABCreateBot": "Crear una Cuenta de Bot",
702-
"FABSeparateBotAccount": "Tu bot necesita una cuenta separada de Metaculus. Asegúrate de cerrar sesión en tu cuenta principal y regresar a esta página.",
703701
"FABBotRegistered": "Tu bot ha sido registrado con éxito en el torneo.",
704-
"FABShowToken": "Mostrar Mi Token",
705702
"FABTournamentPage": "Las Preguntas",
706703
"FABHowItWorks": "Comenzar",
707704
"FABCreateBotAccount": "Crear una Cuenta de Bot",
@@ -1762,5 +1759,30 @@
17621759
"privateNotes": "Notas privadas",
17631760
"justNow": "justo ahora",
17641761
"cmmButtonShort": "Mente",
1762+
"FABRegisterBot": "Regístrate para inscribir tu bot en el torneo",
1763+
"FABRegisterBotSecondary": "Crearás tu bot de pronóstico después de registrarte.",
1764+
"FABCreateAccount": "Crear Cuenta",
1765+
"FABCreatePopupDescription": "Crea una cuenta personal en Metaculus para participar en el torneo.\nDespués de registrarte, se te guiará para crear tu bot de pronóstico desde\nConfiguración → Mis Bots de Pronóstico.",
1766+
"FABCreateBotTitle": "Crea tu primer bot de pronóstico",
1767+
"FABCreateBotDescription": "Una vez creado, el bot será registrado automáticamente para el torneo.",
1768+
"FABShowToken": "Mostrar Token del Bot",
1769+
"myForecastingBots": "Mis Bots de Pronóstico",
1770+
"myBots": "Mis Bots",
1771+
"createBot": "Crear Bot",
1772+
"myForecastingBotsDisclaimer": "Los comentarios extensos de bots que no añadan valor serán considerados spam y se tratarán según lo dispuesto en nuestras directrices, incluyendo la desactivación de la cuenta por reincidencia. Los comentarios privados son aceptables dentro de límites razonables.",
1773+
"myBotsEmpty": "Aún no tienes ningún bot.\n\n Si necesitas ayuda, consulta nuestra documentación sobre <link>Cómo Configurar Bots</link>.",
1774+
"createBotDescription": "Esto creará un bot vinculado a tu usuario, permitiéndote gestionar su configuración y actividad desde aquí",
1775+
"botUsername": "Nombre de usuario del Bot",
1776+
"botCreated": "Bot creado",
1777+
"botCreatedDescription": "Esta es la clave API de tu bot — cópiala y guárdala de forma segura.\nPuedes revelarla más adelante en la configuración de bots de pronóstico.",
1778+
"primaryBotEligibleDisclaimer": "Solo tu primer bot es elegible para premios.",
1779+
"editBotDescription": "Actualiza los detalles de tu bot. Todos los cambios se reflejarán en su página de perfil.",
1780+
"revealApiKey": "Revelar Clave API",
1781+
"hideApiKey": "Ocultar Clave API",
1782+
"accessToken": "Token de Acceso",
1783+
"copy": "copiar",
1784+
"switchToBotAccount": "Cambiar a cuenta de bot",
1785+
"impersonationBannerText": "Actualmente estás viendo Metaculus como tu bot.",
1786+
"stopImpersonating": "Volver a mi cuenta",
17651787
"othersCount": "Otros ({count})"
17661788
}

front_end/messages/pt.json

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -776,11 +776,8 @@
776776
"FABHeroSubtitle": "Série de Benchmark",
777777
"FABHeroDesc": "Comparando o estado da arte em previsão por IA com os melhores humanos em perguntas do mundo real.",
778778
"FABGettingStarted": "Primeiros Passos",
779-
"FABRegisterBot": "Registre seu bot para o torneio",
780779
"FABCreateBot": "Criar uma Conta de Bot",
781-
"FABSeparateBotAccount": "Seu bot precisa de uma conta separada no Metaculus. Certifique-se de sair da sua conta principal e voltar a esta página.",
782780
"FABBotRegistered": "Seu bot foi registrado com sucesso no torneio.",
783-
"FABShowToken": "Mostrar Meu Token",
784781
"FABTournamentPage": "As Perguntas",
785782
"FABHowItWorks": "Como Funciona",
786783
"FABCreateBotAccount": "Criar uma Conta de Bot",
@@ -1760,5 +1757,30 @@
17601757
"privateNotes": "Notas Privadas",
17611758
"justNow": "agora mesmo",
17621759
"cmmButtonShort": "Mente",
1760+
"FABRegisterBot": "Inscreva-se para registrar seu bot no torneio",
1761+
"FABRegisterBotSecondary": "Você criará seu bot de previsão após se inscrever.",
1762+
"FABCreateAccount": "Criar Conta",
1763+
"FABCreatePopupDescription": "Crie uma conta pessoal no Metaculus para participar do torneio.\nApós se inscrever, você será guiado para criar seu bot de previsão em\nConfigurações → Meus Bots de Previsão.",
1764+
"FABCreateBotTitle": "Crie seu primeiro bot de previsão",
1765+
"FABCreateBotDescription": "Uma vez criado, o bot será registrado automaticamente no torneio.",
1766+
"FABShowToken": "Mostrar Token do Bot",
1767+
"myForecastingBots": "Meus Bots de Previsão",
1768+
"myBots": "Meus Bots",
1769+
"createBot": "Criar Bot",
1770+
"myForecastingBotsDisclaimer": "Comentários longos de bots que não adicionam valor serão considerados spam e tratados conforme previsto em nossas diretrizes, podendo incluir a desativação da conta em caso de reincidência. Comentários privados são permitidos dentro de limites razoáveis.",
1771+
"myBotsEmpty": "Você ainda não tem bots.\n\nSe precisar de ajuda, consulte nossa documentação sobre <link>Como Configurar Bots</link>.",
1772+
"createBotDescription": "Isto criará um bot vinculado ao seu usuário, permitindo que você gerencie suas configurações e atividades daqui",
1773+
"botUsername": "Nome de usuário do Bot",
1774+
"botCreated": "Bot criado",
1775+
"botCreatedDescription": "Este é a chave da API do seu bot — copie e armazene com segurança.\nVocê pode revelá-la posteriormente nas configurações dos bots de previsão.",
1776+
"primaryBotEligibleDisclaimer": "Apenas seu primeiro bot é elegível para prêmios.",
1777+
"editBotDescription": "Atualize os detalhes do seu bot. Todas as alterações serão refletidas na página de perfil dele.",
1778+
"revealApiKey": "Revelar Chave da API",
1779+
"hideApiKey": "Ocultar Chave da API",
1780+
"accessToken": "Token de Acesso",
1781+
"copy": "copiar",
1782+
"switchToBotAccount": "Mudar para Conta de Bot",
1783+
"impersonationBannerText": "Você está visualizando o Metaculus atualmente como seu bot.",
1784+
"stopImpersonating": "Voltar para minha conta",
17631785
"othersCount": "Outros ({count})"
17641786
}

front_end/messages/zh-TW.json

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -838,11 +838,8 @@
838838
"FABHeroSubtitle": "基準系列",
839839
"FABHeroDesc": "在真實世界問題上,將AI預測的最前沿與最優秀的人類進行基準對比。",
840840
"FABGettingStarted": "開始",
841-
"FABRegisterBot": "註冊您的機器人參加比賽",
842841
"FABCreateBot": "創建一個機器人帳號",
843-
"FABSeparateBotAccount": "您的機器人需要獨立的Metaculus帳號。請確保登出您的主帳號並返回此頁面。",
844842
"FABBotRegistered": "您的機器人已成功註冊參賽。",
845-
"FABShowToken": "顯示我的令牌",
846843
"FABTournamentPage": "問題",
847844
"FABHowItWorks": "開始指南",
848845
"FABCreateBotAccount": "創建一個機器人帳號",
@@ -1759,5 +1756,30 @@
17591756
"privateNotes": "私人筆記",
17601757
"justNow": "剛剛",
17611758
"cmmButtonShort": "心智",
1759+
"FABRegisterBot": "註冊以參加賽事",
1760+
"FABRegisterBotSecondary": "註冊後您將創建您的預測機器人。",
1761+
"FABCreateAccount": "創建帳號",
1762+
"FABCreatePopupDescription": "創建個人的Metaculus帳號以參加賽事。\n註冊後,您將被引導從\n設定 → 我的預測機器人創建您的預測機器人。",
1763+
"FABCreateBotTitle": "創建您的第一個預測機器人",
1764+
"FABCreateBotDescription": "一旦創建,機器人將自動註冊參加賽事。",
1765+
"FABShowToken": "顯示機器人令牌",
1766+
"myForecastingBots": "我的預測機器人",
1767+
"myBots": "我的機器人",
1768+
"createBot": "創建機器人",
1769+
"myForecastingBotsDisclaimer": "不增加價值的冗長機器人評論將被視為垃圾訊息,將按照我們的指導方針進行處理,包括在重複違規的情況下停用帳戶。私人評論在合理範圍內是可以的。",
1770+
"myBotsEmpty": "您還沒有任何機器人。\n\n如果需要幫助,請查閱我們的關於 <link>如何設置機器人</link> 的文檔。",
1771+
"createBotDescription": "這將創建一個鏈接到您的用戶的機器人,使您可以在此管理其設定和活動",
1772+
"botUsername": "機器人用戶名",
1773+
"botCreated": "機器人已創建",
1774+
"botCreatedDescription": "這是您的機器人的API密鑰——請複製並妥善存放。\n稍後可以在預測機器人的設置中查看。",
1775+
"primaryBotEligibleDisclaimer": "僅您的第一個機器人有資格獲得獎品。",
1776+
"editBotDescription": "更新您的機器人詳細信息。所有更改將反映在其頁面上。",
1777+
"revealApiKey": "顯示API密鑰",
1778+
"hideApiKey": "隱藏API密鑰",
1779+
"accessToken": "訪問令牌",
1780+
"copy": "複製",
1781+
"switchToBotAccount": "切換到機器人帳戶",
1782+
"impersonationBannerText": "您目前正在以您的機器人帳戶查看 Metaculus。",
1783+
"stopImpersonating": "切換回我的帳戶",
17621784
"withdrawAfterPercentSetting2": "問題總生命周期後撤回"
17631785
}

front_end/messages/zh.json

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -686,11 +686,8 @@
686686
"FABHeroSubtitle": "基準系列",
687687
"FABHeroDesc": "在真實世界問題上對比最先進的人工智能預測與最優秀的人類。",
688688
"FABGettingStarted": "開始",
689-
"FABRegisterBot": "將你的機器人註冊到競賽",
690689
"FABCreateBot": "創建機器人帳戶",
691-
"FABSeparateBotAccount": "你的機器人需要一個單獨的Metaculus帳戶。確保登出你的主帳戶並返回此頁面。",
692690
"FABBotRegistered": "你的機器人已成功註冊參加競賽。",
693-
"FABShowToken": "顯示我的令牌",
694691
"FABTournamentPage": "问题",
695692
"FABHowItWorks": "入门",
696693
"FABCreateBotAccount": "創建機器人帳戶",
@@ -1764,5 +1761,30 @@
17641761
"privateNotes": "私人筆記",
17651762
"justNow": "刚刚",
17661763
"cmmButtonShort": "心情",
1764+
"FABRegisterBot": "注册您的机器人以参加锦标赛",
1765+
"FABRegisterBotSecondary": "注册后,您将创建您的预测机器人。",
1766+
"FABCreateAccount": "创建账户",
1767+
"FABCreatePopupDescription": "创建一个个人 Metaculus 账户以参加锦标赛。\n注册后,您将在设置中创建您的预测机器人 → 我的预测机器人。",
1768+
"FABCreateBotTitle": "创建您的第一个预测机器人",
1769+
"FABCreateBotDescription": "一旦创建,机器人将自动注册参加锦标赛。",
1770+
"FABShowToken": "显示机器人令牌",
1771+
"myForecastingBots": "我的预测机器人",
1772+
"myBots": "我的机器人",
1773+
"createBot": "创建机器人",
1774+
"myForecastingBotsDisclaimer": "冗长的机器人评论如不具价值,将被视为垃圾信息,并按我们的指导原则处理,包括在多次违规情况下停用账户。在合理范围内,私人评论是可以的。",
1775+
"myBotsEmpty": "您还没有任何机器人。\n\n如果您需要帮助,请查看我们的文档<链接>如何设置机器人</链接>。",
1776+
"createBotDescription": "这将创建一个链接到您的用户的机器人,使您能够从这里管理其设置和活动",
1777+
"botUsername": "机器人用户名",
1778+
"botCreated": "机器人已创建",
1779+
"botCreatedDescription": "这是您机器人的 API 密钥——请妥善复制和保存。\n您可以稍后在预测机器人设置中揭示它。",
1780+
"primaryBotEligibleDisclaimer": "只有您的第一个机器人有资格获得奖品。",
1781+
"editBotDescription": "更新您机器人的详细信息。所有更改将反映在其个人资料页面上。",
1782+
"revealApiKey": "揭示 API 密钥",
1783+
"hideApiKey": "隐藏 API 密钥",
1784+
"accessToken": "访问令牌",
1785+
"copy": "复制",
1786+
"switchToBotAccount": "切换到机器人账户",
1787+
"impersonationBannerText": "您当前正在以机器人身份查看 Metaculus。",
1788+
"stopImpersonating": "切换回我的账户",
17671789
"othersCount": "其他({count})"
17681790
}

front_end/next.config.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ const nextConfig = {
7070
source: "/index/:slug",
7171
destination: "/tournament/:slug",
7272
},
73+
{
74+
source: "/aib",
75+
destination: "/aib/2026/spring/",
76+
},
7377
];
7478
},
7579
eslint: {

0 commit comments

Comments
 (0)