{"id":14983226,"url":"https://github.com/focus04/focus","last_synced_at":"2025-04-08T04:19:35.899Z","repository":{"id":42232035,"uuid":"278400860","full_name":"Focus04/focus","owner":"Focus04","description":"Professional Discord moderation bot.","archived":false,"fork":false,"pushed_at":"2024-06-19T18:01:03.000Z","size":3413,"stargazers_count":154,"open_issues_count":8,"forks_count":53,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-08T04:19:23.030Z","etag":null,"topics":["discord","discord-bot","discord-js","keyv","mongodb","mongodb-atlas","node-fetch","node-js","nodejs"],"latest_commit_sha":null,"homepage":"https://focus04.github.io/Focus/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Focus04.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-09T15:23:10.000Z","updated_at":"2025-02-26T07:29:10.000Z","dependencies_parsed_at":"2024-02-22T14:26:01.808Z","dependency_job_id":"7790a68f-210d-4078-883f-f9ec00c1cb8b","html_url":"https://github.com/Focus04/focus","commit_stats":{"total_commits":574,"total_committers":4,"mean_commits":143.5,"dds":"0.017421602787456414","last_synced_commit":"99008de9420609f429d5b0440a264faed41dd54e"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Focus04%2Ffocus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Focus04%2Ffocus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Focus04%2Ffocus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Focus04%2Ffocus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Focus04","download_url":"https://codeload.github.com/Focus04/focus/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247773883,"owners_count":20993658,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["discord","discord-bot","discord-js","keyv","mongodb","mongodb-atlas","node-fetch","node-js","nodejs"],"created_at":"2024-09-24T14:06:55.785Z","updated_at":"2025-04-08T04:19:35.880Z","avatar_url":"https://github.com/Focus04.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Focus\n## Overview\n*Revamp your Discord server. Moderation, role management, logging and more, all in an easy to use, feature rich and bug free Discord bot!*\n## Command List\n### Debug Commands\n- `/botinfo` Checks how many servers the bot is in.\n- `/botsuggestion` Submits a suggestion directly to the bot's Discord server.\n- `/bugreport` Submits a bug report directly to the bot's Discord server.\n- `/discordserver` Sends an invite link to the bot's support server.\n- `/invitelink` Sends the invite link for the bot.\n- `/ping` Displays the bot's current latency in ms.\n- `/serversettings` Sends current bot settings for this server.\n### Fun Commands\n- `/approved` Approves your profile picture or someone else's.\n- `/blur` Blurs your profile picture or someone else's.\n- `/dogfact` Sends a lovely dog fact.\n- `/catfact` Same as dogfact, except it's for cats.\n- `/contrast` Adds contrast effect to your profile picture or someone else's.\n- `/deepfry` Add deepfried effect to your profile picture or someone else's.\n- `/define` Looks up a term in the dictionary.\n- `/nasanews` Looks up an astronomy-related term on NASA's Website and returns a fact about it.\n- `/weather` Tells you information about the weather in a given location.\n- `/yomomma` Sends a your mom joke to someone.\n### Info Commands\n- `/avatar` Displays the avatar of a user.\n- `/help` Displays a list of all available commands along with their usage.\n- `/serverinfo`  Displays information about the server you're in.\n- `/userinfo` Displays information about a user's account account.\n### Staff Commands\n- `/addnote` Adds an admin note on someone's account. All staff members will be able to view this note.\n- `/ban` Restricts a user's access to the server.\n- `/baninfo` View details about a banned user.\n- `/checknames` Check a member's previous nicknames.\n- `/clear` Bulk deletes a certain amount of messages.\n- `/delnote` Deletes a note from a user.\n- `/delsuggestion` Deletes a suggestion.\n- `/disablecmd` Disables a command from the server.\n- `/editnote` Edits a note from a user.\n- `/enablecmd` Enables a command from the server.\n- `/kick` Kicks a user out of the server.\n- `/mute` Restricts a user from sending messages.\n- `/muteinfo` View details about a muted member.\n- `/record` Displays how many punishments a user has ever received on the server.\n- `/remindme` Sets a timer for a reminder.\n- `/report` Submits a report to the staff's logs channel.\n- `/serversuggestion` Submit a server suggestion.\n- `/setlogschannel` Sets a custom channel where moderation logs will be sent.\n- `/suggestion` Accept or decline a suggestion from your suggestion channel.\n- `/suggestionchannel` Sets a channel for suggestions to be sent in.\n- `/togglemsglogs` Toggles message logs on/off.\n- `/unban` The username of the banned user.\n- `/unmute` Removes a user's muted status earlier.\n- `/viewnotes` Shows all notes linked to a user from this server.\n- `/warn` Sends a warning message to a user.\n### Role Commands\n- `/rolepicker` Creates a menu that automatically assigns roles to users that react to it.\n- `/addroletorp` Adds a role option to an existent role picker.\n- `/removerolefromrp` Removes a role option from an existent role picker.\n- `/disablerp` Disables an existent role picker.\n- `/enablerp` Enables a disabled role picker.\n- `/giverole` Adds a role to a user.\n- `/takerole` Removes a role from a user.\n### Welcome Commands\n- `/setwelcomechannel` Sets a custom channel where newcommers will receive a welcome message.\n- `/setleavechannel` Sets a custom channel where leaving members will be logged.\n- `/welcomemessage` Sets a custom welcome message to be displayed when someone joins the server.\n- `/leavemessage` Sets a custom good bye message for those leaving the server.\n- `/welcomedm` Sets a custom welcome message that will be inboxed to new users.\n- `/welcomerole` Sets a role to be assigned to new users when they join the server.\n- `/togglewelcomemsg` Toggles welcome messages on/off.\n- `/toggleleavemsg` Toggles leave messages on/off.\n- `/togglewelcomedm` Toggles welcome DMs on/off.\n## Reviews\n\u003e It's a really useful and good bot. Easy to manage. I would recommend everyone to add this to their respective servers.\n\n\u003e A really useful and easy to use bot.\n## Official Invite Link\nYou can invite my official bot running on the latest version [from here](https://discord.com/oauth2/authorize?client_id=723094801175806024\u0026permissions=268561494\u0026scope=bot%20applications.commands).\n## Installation Guide\nThis guide will cover all the steps needed to get a bot up and running from absolute scratch using my source code. If you stumble across any issues with setting it up, my [Discord server](https://discord.gg/r4bsXez) is the right place to seek help.\nPlease note though, I strongly advice that you have a decent understanding of JavaScript, Node.js and discord.js before diving into this.\n### 1. Creating a Bot Account\n*  Open your browser, go to Discord's [Developer Portal](https://discord.com/developers/applications), click on `New Application` and give your application a name.\n\n* Click on the application you've just created and navigate into `Bot`. Here you can give your bot a username, description (that will show up in the About Me section) and an avatar. You want to make sure that the `Server Members Intent` stays enabled.\n\n* In order to have your bot join any servers, you have to create an invite link. The invite url will contain your bot's user ID (which you can copy from the `Application` menu). Simply replace `[your_bot_id]` with your bot client ID you just copied in the template below, then use it to invite the bot.\n  ```\n  https://discord.com/oauth2/authorize?client_id=[your_bot_id]\u0026permissions=268561494\u0026scope=bot%20applications.commands\n  ```\n### 2. Connecting The Code To The Bot\n* Before downloading the bot's source code, you must download and install [Node.js](https://nodejs.org/en/) on your computer.\n\n* You can now proceed to download [the latest code](https://github.com/Focus04/focus/releases). Scroll to the latest release and download the corresponding zip file, then extract it somewhere on your computer.\n\n* Navigate into the folder you've just extracted (which should contain all the code), right click and open a new terminal in the folder (my recommendation would be [PowerShell 7](https://github.com/PowerShell/powershell/releases) if you're a Windows user). Use the following command to install all the dependencies:\n  ```\n  npm i\n  ```\n\n* Go back to the `Developer Portal` into your browser and navigate into `Bot`. Here you want to click on `Copy` to copy your bot's token. This token is the password for your bot account, so you want to keep that as secure as possible in an environment variable.\n\n* Open the code using your preferred text editor (I recommend sticking to [Visual Studio Code](https://code.visualstudio.com/)). To speed this up, you can type `code.` in the terminal.\n\n* With your text editor, navigate into the `.env` file and replace `your_bot_token` with the token you just copied, then hit save. \n### 3. Configuring the bot\n  * The bot offers suggestions and bug reporting features. For those to work, you have to create 2 channels for suggestions and bug reports respectively.\n\n  * Right click on the suggestions channel, then hit `Copy ID`. Replace the `changeme` in the `suggestionChId` field with the ID you copied.\n\n  * Repeat for the bug reports channel by editing the `bugChId` field.\n\n  * You can finally edit your `botInviteLink`, `discordInviteLink`, `topgg`, `website` and `github` fields with your own urls (or leave them empty).\n\n  * You can also edit the `package.json` file.\n### 4. Setting up the database\n  * Here comes the trickier part, setting up a MongoDB database for the bot to store its data in. Start by registering an account at [MongoDB](https://www.mongodb.com/).\n\n  * Navigate to `Databases`, then hit `Create`. Select your prefered options (there are options for free tier clusters too). When you're done, click `Create Cluster`. The creation process can take several minutes, so be patient.\n\n  * Once the cluster goes live, click on `Browse Collections` and hit `Create Database`. Here you have to create a database for each field in the `.env` file (22 in total). You can start with `bannedUsers`. The name of the database is up to you but make sure it's something suggestive as you'll need it later. You can now click `Create`.\n\n  * Repeat for the remaining fields (`bns`, `disabledCmds`, `kks`, `leaveMessages`, `leaveChannels`, `logChannels`, `msgLogs`, `mts`, `mutedMembers`, `names`, `notes`, `punishments`, `reminders`, `suggestionChannels`, `toggleLeaveMsg`, `toggleWelcomeDm`, `toggleWelcomeMsg`, `welcomeChannels`, `welcomeDms`, `welcomeMessages`, `welcomeRoles` \u0026 `wrns`).\n\n  * Go back to your cluster overview, click `Connect` and choose the second option. Here you have to choose `Node.js` and the `2.2.12 or later` version. Copy the connection string. Replace `database_url` with the url you copied in all fields of the `.env`. Replace `\u003cpassword\u003e` with the password you set on your cluster. Replace `myFirstDatabase` with the name of the database that you created for the corresponding field. There should be 25 databases in total, which equates to 25 connection strings.\n### 5. Generating API Keys\n  * In order for the weather command to work, you'll need to generate a key for the [OpenWeatherMap API](https://openweathermap.org/api). Register an account there.\n  \n  * On the homepage, click on your username and go to `My API keys`.\n\n  * Input a name for your key and hit `Generate`.\n\n  * Copy the newly generated key, go to the `.env` file and replace `your_open_weather_map_api_key` with it.\n### 6. Starting up the bot\n  * At this point you're pretty much done. You can now run the following command in your terminal to start the bot. Remember to use it everytime you update the source code:\n  ```\n  node .\n  ```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffocus04%2Ffocus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffocus04%2Ffocus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffocus04%2Ffocus/lists"}