I moderate a small community and wanted a simple automated weekly contest bot that automatically publishes a scheduled weekly thread and evaluates flaired contest posts on a weekly schedule and assigns user flairs to winners and gives me two manual moderator menu buttons (Test Contest Scorer and Run Weekly Contest Winners Now) in the subreddit's top-right ... menu so I can test and trigger it manually.
The app bundles (esbuild), uploads, and installs onto my subreddit without any errors. Other Devvit apps I've installed show their buttons in the desktop top-right ... menu (next to Mod Tools), but neither of my two Devvit.addMenuItem buttons appear there at all**.**
I'm using u/devvit/public-api ^0.15.6 with devvit.json (since devvit.yaml seemed deprecated). I tried both leaving "menu" out of devvit.json and adding a "menu" block in devvit.json, and neither made the buttons show up in the UI
I'm a beginner developer and completely new to Devvit, I built this app by vibe coding, so I'm still learning how all the pieces fit together
./devvit.json
{
"name": "notactualname",
"server": {
"dir": "dist",
"entry": "main.js"
},
"permissions": {
"reddit": {
"enable": true
},
"redis": true
}
}
./src/main.ts
import { Devvit, JobContext, TriggerContext } from '@devvit/public-api';
Devvit.configure({
redditAPI: true,
redis: true,
});
// ... (scoring logic & weekly cron jobs) ...
Devvit.addMenuItem({
label: 'Test Contest Scorer (All Posts)',
location: 'subreddit',
forUserType: 'moderator',
onPress: async (_event, context) => {
context.ui.showToast('Calculating scores for all existing posts...');
const result = await runContestEvaluation(context, true);
context.ui.showToast(result);
},
});
Devvit.addMenuItem({
label: 'Run Weekly Contest Winners Now',
location: 'subreddit',
forUserType: 'moderator',
onPress: async (_event, context) => {
context.ui.showToast('Scoring this week’s [Contest] entries & assigning flairs...');
const result = await runContestEvaluation(context, false);
context.ui.showToast(result);
},
});
export default Devvit;