{"id":19989186,"url":"https://github.com/clamytoe/mohhsbot","last_synced_at":"2025-07-22T16:06:33.914Z","repository":{"id":84639586,"uuid":"111968744","full_name":"clamytoe/MohhsBot","owner":"clamytoe","description":"Small Slack bot that will get you a random desktop wallpaper based on your search pattern.","archived":false,"fork":false,"pushed_at":"2018-12-12T01:51:45.000Z","size":265,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-01T21:48:10.924Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/clamytoe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-11-25T01:54:32.000Z","updated_at":"2018-12-12T01:51:46.000Z","dependencies_parsed_at":"2023-07-21T07:32:11.732Z","dependency_job_id":null,"html_url":"https://github.com/clamytoe/MohhsBot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/clamytoe/MohhsBot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clamytoe%2FMohhsBot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clamytoe%2FMohhsBot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clamytoe%2FMohhsBot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clamytoe%2FMohhsBot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clamytoe","download_url":"https://codeload.github.com/clamytoe/MohhsBot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clamytoe%2FMohhsBot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266524930,"owners_count":23942840,"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","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-13T04:45:46.264Z","updated_at":"2025-07-22T16:06:33.886Z","avatar_url":"https://github.com/clamytoe.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mohhsbot (wally)\r\n\u003e Small Slack bot that will get you a random desktop wallpaper based on your search pattern.\r\n\r\n[![GitHub issues][issues-image]][issues-url]\r\n[![GitHub forks][fork-image]][fork-url]\r\n[![GitHub Stars][stars-image]][stars-url]\r\n[![License][license-image]][license-url]\r\n![Python version][python-version]\r\n\r\nThis is a **Python 3.6** script that I wrote using [Anaconda](https://anaconda.org/) but you should have no problem running it in just a Python installation. This is loosely based on my *bash* implementation of [randPic](https://github.com/clamytoe/randPic).\r\n\r\n## Anaconda Installation\r\n```bash\r\ncd Documents\\Projects\\\r\ngit clone https://github.com/clamytoe/MohhsBot.git\r\ncd MohhsBot\r\nconda env create -f environment.yml\r\n```\r\n\r\n## Regular Installation\r\n```bash\r\ncd Documents/Projects/\r\ngit clone https://github.com/clamytoe/MohhsBot.git\r\ncd MohhsBot\r\npython -m venv venv\r\nsource ./venv/bin/activate\r\npip install -r requirements.txt\r\n```\r\n\r\n## Configuration\r\nI played around with two different ways of storing the bot keys. One way was to use environment variables, the other was to create a keys.py file. That one looks like this:\r\n```python\r\nBOT_ID = 'U854JKLNS'\r\nBOT_NAME = 'mohh'\r\nCHANNEL_ID = '...'\r\nSLACK_BOT_TOKEN = '...'\r\n```\r\nI'll leave it up to you to figure out how to use environment variables if you want to go that route.\r\n\u003e**NOTE:** Only the *BOT_ID*, *SLACK_BOT_TOKEN* are needed for the script to work. The others are used during testing...\r\n\r\n## Testing\r\nI started this project with some test driven development (TDD), but I quickly reached the limits of my [PyTest](https://docs.pytest.org/en/latest/) knowledge when it came time to testing the Slack code. Currently it only tests the local code and establishing the connection.\r\n\r\nTo run the provided tests, simple run the following command:\r\n\r\n```bash\r\n(mohhsbot): pytest\r\n============================= test session starts =============================\r\nplatform win32 -- Python 3.6.3, pytest-3.2.5, py-1.5.2, pluggy-0.4.0 -- C:\\Users\\clamytoe\\virtualenvs\\mohhsbot\\Scripts\\python.exe\r\ncachedir: .cache\r\nrootdir: C:\\Users\\clamytoe\\Documents\\Projects\\MohhsBot, inifile:\r\ncollecting ... collected 3 items\r\ntest_mohhsbot.py::test_environment_variables PASSED\r\ntest_mohhsbot.py::test_slack_connection PASSED\r\ntest_mohhsbot.py::test_bot_id PASSED\r\n\r\n========================== 3 passed in 0.55 seconds ===========================\r\nProcess finished with exit code 0\r\n```\r\n\r\n## Getting your bot's ID\r\nI've provided a little script that should help you get the ID of your bot. If you are not getting the ID, uncomment the *print()* statement to help you find it.\r\n\r\n```bash\r\n(mohhsbot): python get_bot_id.py\r\nBot ID for \"mohh\" is U854JKLNS\r\n```\r\n\r\n## Running the bot\r\nOnce you have everything configured and you can run the initial test successfully, you should be ready to run the bot. Start it like so:\r\n\r\n```bash\r\n(mohhsbot): python mohhsbot.py\r\nBot connected and running!\r\n```\r\n\r\n## Using the bot on Slack\r\nMake sure to add the bot to one of your channels in order to have it response to image search commands. Here is a sample run:\r\n\r\n![wally](demo.png)\r\n\r\n[issues-image]:https://img.shields.io/github/issues/clamytoe/MohhsBot.svg\r\n[issues-url]:https://github.com/clamytoe/MohhsBot/issues\r\n[fork-image]:https://img.shields.io/github/forks/clamytoe/MohhsBot.svg\r\n[fork-url]:https://github.com/clamytoe/MohhsBot/network\r\n[stars-image]:https://img.shields.io/github/stars/clamytoe/MohhsBot.svg\r\n[stars-url]:https://github.com/clamytoe/MohhsBot/stargazers\r\n[license-image]:https://img.shields.io/github/license/clamytoe/MohhsBot.svg\r\n[license-url]:https://github.com/clamytoe/MohhsBot/blob/master/LICENSE\r\n[python-version]:https://img.shields.io/badge/python-3.6%2B-brightgreen.svg\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclamytoe%2Fmohhsbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclamytoe%2Fmohhsbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclamytoe%2Fmohhsbot/lists"}