{"id":22358345,"url":"https://github.com/thedvlprs/tutorial-bot","last_synced_at":"2025-03-26T13:43:40.918Z","repository":{"id":114655335,"uuid":"185181352","full_name":"thedvlprs/Tutorial-Bot","owner":"thedvlprs","description":"🤖 simple Discord bot for tutorial purposes ","archived":false,"fork":false,"pushed_at":"2024-06-18T01:00:53.000Z","size":4812,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-01-31T15:17:05.943Z","etag":null,"topics":["codenewbie","discord-bot","javascipt","tutorial"],"latest_commit_sha":null,"homepage":"","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/thedvlprs.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}},"created_at":"2019-05-06T11:14:28.000Z","updated_at":"2019-06-02T19:42:43.000Z","dependencies_parsed_at":"2024-02-08T05:35:13.679Z","dependency_job_id":null,"html_url":"https://github.com/thedvlprs/Tutorial-Bot","commit_stats":null,"previous_names":["thedvlprs/tutorial-bot"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thedvlprs%2FTutorial-Bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thedvlprs%2FTutorial-Bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thedvlprs%2FTutorial-Bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thedvlprs%2FTutorial-Bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thedvlprs","download_url":"https://codeload.github.com/thedvlprs/Tutorial-Bot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245667554,"owners_count":20652982,"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":["codenewbie","discord-bot","javascipt","tutorial"],"created_at":"2024-12-04T15:14:22.030Z","updated_at":"2025-03-26T13:43:40.893Z","avatar_url":"https://github.com/thedvlprs.png","language":"JavaScript","readme":"# Tutorial-Bot\n--------------\na simple Discord bot for tutorial purposes [простой бот для учебных целей]\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![GitHub contributors](https://img.shields.io/github/contributors/Naereen/StrapDown.js.svg)](https://GitHub.com/Naereen/StrapDown.js/graphs/contributors/) [![Open Source Love png1](https://badges.frapsoft.com/os/v1/open-source.png?v=103)](https://github.com/ellerbrock/open-source-badges/) [![saythanks](https://img.shields.io/badge/say-thanks-ff69b4.svg)](https://saythanks.io/to/kennethreitz)\n\n[![ForTheBadge built-with-love](http://ForTheBadge.com/images/badges/built-with-love.svg)](https://GitHub.com/Naereen/)\n\n\n## Создаем бота в Discord для сервера\n\n###**Вам понадобятся**:\u003cbr /\u003e\n- Редактор кода \u003e [Visual Studio Code](https://code.visualstudio.com/)\u003cbr /\u003e\n- [Node JS](https://nodejs.org/en/)\u003cbr /\u003e\n- [Библиотека Discord.js](https://discord.js.org/#/)\u003cbr /\u003e\n\u003cbr /\u003e\n\n1) Открываем редактор кода (VSCode) и через **\"Add workspace folder\"** создаем папку для проекта\n\n![](images/15.29.16.png)\n\n2) Открываем терминал в редакторе **\u003e Terminal \u003e New Terminal и вводим команду \u003e**\n\n\t\t\t`npm init` \n\n![](images/15.35.27.png)\n\nв конце на вопрос **Is this OK? (yes) \u003e** набираем команду **yes** \u003cbr /\u003e\nТеперь в рабочей папке появился файл **\u003e package.json**\n\nОткрываем его в редакторе, в **\"description\"** прописываем описание вашего бота и по желанию в графе **\"author\"** (автор) свои инициалы. Сохраняем через команду:\u003cbr /\u003e **CMD + S** для **Mac OS** или \u003cbr /\u003e**CTRL + S** для **Windows**.\n\n![](images/15.38.29.png)\n\n3) Возвращаемся в терминал и подключаем модуль Дискорда через **команду:**\n                     \n \t\t`npm install discord.js --save` \n\n![](images/15.44.23.png)\n\n4) Переходим в файл **index.js** и прописываем две строки кода: \n\n\t\t`const Discord = require(\"discord.js\");`\n\t\t`const client = new Discord.Client();`\n\n**NB:** Вместо **\"Discord\"** и **\"client\"** можно вставить свои названия.\n\n5) Переходим на сайт [Discord Developer Portal](https://discordapp.com/developers/applications/) для регистрации бота в своем Дискорде через функцию **\"New Application\"**\n\n![](images/15.49.21.png)\n\n6) Далее копируем токен бота (предварительно создав его через функцию **\"Add bot\"**) и переходим в редактор, дописываем следующую строку кода:\n\n\t\t`client.login(\"ВАШ_ТОКЕН\");`\n\n![](images/15.50.53.png)\n\n![](images/15.51.16.png)\n\n7) Для добавления бота на сервер, переходим в раздел **\"General Information\"** и копируем **Client ID**.\n\n![](images/15.50.37.png)\n\n8) Далее переходим на страницу **Discord \u003e Permissions Calculator**, тикаем все боксы и в нижней графе **Client ID** вставляем скопированный **ID-номер**. Далее переходим по ссылке для авторизации и добавления бота на сервер. \n\n![](images/DiscordPermissionsCalculator.png)\n\n\n9) Прописываем простую команду для бота в файле **index.js**:\n\n```javascript\n\nclient.on('message', (message) =\u003e {\n    if(message.content == \"hello bot\") // если содержимое сообщения \"hello bot\" (можете подставить свой текст)\n    {\n        message.channel.send(\"hi there!\"); // бот отправит сообщение \"hi there!\" (можете подставить свой текст)\n    }\n});\n```\n\n![](images/16.12.16.png)\n\n10) Запускаем бота через терминал командой:\u003cbr /\u003e\u003cbr /\u003e\n\t\t`node .`\n\n\n![](images/16.08.25.png)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthedvlprs%2Ftutorial-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthedvlprs%2Ftutorial-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthedvlprs%2Ftutorial-bot/lists"}