title: Ð¡Ð¾Ð·Ð´Ð°Ð½Ð¸Ðµ Discord-Ð±Ð¾ÑÐ° Ð´Ð»Ñ Ð²Ð¾ÑÐ¿ÑÐ¾Ð¸Ð·Ð²ÐµÐ´ÐµÐ½Ð¸Ñ Ð°ÑÐ´Ð¸Ð¾
title: Ð²ÑÐ¿ÑÑÐºÐ½Ð°Ñ ÐºÐ²Ð°Ð»Ð¸ÑÐ¸ÐºÐ°ÑÐ¸Ð¾Ð½Ð½Ð°Ñ ÑÐ°Ð±Ð¾ÑÐ° Ð±Ð°ÐºÐ°Ð»Ð°Ð²ÑÐ°
titleType: Subtitle
title: Creating a Discord bot for audio playback
Creators: name: ÐÑÑÐµÐ¼ÑÐµÐ², ÐÐ¸ÐºÐ¸ÑÐ°
Publisher: name: Ð¡Ð°Ð½ÐºÑ-ÐÐµÑÐµÑÐ±ÑÑÐ³ÑÐºÐ¸Ð¹ Ð¿Ð¾Ð»Ð¸ÑÐµÑÐ½Ð¸ÑÐµÑÐºÐ¸Ð¹ ÑÐ½Ð¸Ð²ÐµÑÑÐ¸ÑÐµÑ ÐÐµÑÑÐ° ÐÐµÐ»Ð¸ÐºÐ¾Ð³Ð¾
Year: 2023
Subjects: Discord
TypeScript
PostgreSQL
JavaScript
NextJS

description: Ð¦ÐµÐ»Ñ ÑÐ°Ð±Ð¾ÑÑ â ÑÐ¾Ð·Ð´Ð°ÑÑ Ð°ÑÐ´Ð¸Ð¾ Ð±Ð¾ÑÐ° Ð´Ð»Ñ Ð²Ð¾ÑÐ¿ÑÐ¾Ð¸Ð·Ð²ÐµÐ´ÐµÐ½Ð¸Ñ Ð¼ÐµÐ´Ð¸Ð° ÑÐ°Ð¹Ð»Ð¾Ð² Ð² Ð¿ÑÐ¾Ð³ÑÐ°Ð¼Ð¼Ðµ DisÑÐ¾rd, Ð²Ð¼ÐµÑÑÐµ Ñ ÑÐ°Ð¹ÑÐ¾Ð¼ Ð´Ð»Ñ Ð°Ð´Ð¼Ð¸Ð½Ð¸ÑÑÑÐ¸ÑÐ¾Ð²Ð°Ð½Ð¸Ñ Ð¸ ÑÐ¿ÑÐ°Ð²Ð»ÐµÐ½Ð¸Ñ ÑÐ°Ð¹Ð»Ð°Ð¼Ð¸ Ð´Ð»Ñ Ð²Ð¾ÑÐ¿ÑÐ¾Ð¸Ð·Ð²ÐµÐ´ÐµÐ½Ð¸Ñ. Ð­ÑÐ° ÑÐ¸ÑÑÐµÐ¼Ð° Ð¿Ð¾Ð·Ð²Ð¾Ð»Ð¸Ñ ÑÐ¿ÑÐ¾ÑÑÐ¸ÑÑ Ð¿ÑÐ¾Ð²ÐµÐ´ÐµÐ½Ð¸Ðµ Ð¾Ð½Ð»Ð°Ð¹Ð½ Ð¾Ð±ÑÑÐµÐ½Ð¸Ñ Ð² ÑÑÐ»Ð¾Ð²Ð¸ÑÑ ÑÐ´Ð°Ð»ÑÐ½Ð½Ð¾Ð¹ ÑÐ°Ð±Ð¾ÑÑ Ð¸ ÑÐ»ÑÑÑÐ¸Ñ ÐºÐ°ÑÐµÑÑÐ²Ð¾ Ð¿ÑÐµÐ¿Ð¾Ð´Ð°Ð²Ð°ÐµÐ¼Ð¾Ð³Ð¾ Ð¼Ð°ÑÐµÑÐ¸Ð°Ð»Ð°, Ð¿Ð¾ÑÑÐµÐ´ÑÑÐ²Ð¾Ð¼ Ð±Ð¾Ð»ÐµÐµ Ð¾Ð±ÑÐ¸ÑÐ½ÑÑ Ð²Ð¾Ð·Ð¼Ð¾Ð¶Ð½Ð¾ÑÑÐµÐ¹ Ð´Ð»Ñ Ð°ÑÐ´Ð¸ÑÐ¾Ð²Ð°Ð½Ð¸Ñ ÑÑÐµÐ½Ð¸ÐºÐ¾Ð². ÐÐ°Ð´Ð°ÑÐ¸, ÐºÐ¾ÑÐ¾ÑÑÐµ ÑÐµÑÐ°Ð»Ð¸ÑÑ Ð² ÑÐ¾Ð´Ðµ ÑÐ°Ð±Ð¾ÑÑ: 1. ÐÐ±ÑÐ°ÑÐµÐ½Ð¸Ðµ Ðº API Discord 2. Ð Ð°Ð·ÑÐ°Ð±Ð°ÑÑÐ²Ð°Ð»Ð°ÑÑ Ð°ÑÑÐ¸ÑÐµÐºÑÑÑÐ° Ð¿ÑÐ¾Ð³ÑÐ°Ð¼Ð¼Ð½Ð¾Ð³Ð¾ Ð¾Ð±ÐµÑÐ¿ÐµÑÐµÐ½Ð¸Ñ 3. ÐÑÐ¾ÐµÐºÑÐ¸ÑÐ¾Ð²Ð°Ð»ÑÑ Ð¸ ÑÐ°Ð·ÑÐ°Ð±Ð°ÑÑÐ²Ð°Ð»ÑÑ ÑÐ°Ð¹Ñ Ð´Ð»Ñ Ð°Ð´Ð¼Ð¸Ð½Ð¸ÑÑÑÐ¸ÑÐ¾Ð²Ð°Ð½Ð¸Ñ 4. ÐÑÐ±ÑÐ°Ð½Ñ ÑÐµÑÐ½Ð¾Ð»Ð¾Ð³Ð¸Ð¸, ÐºÐ¾ÑÐ¾ÑÑÐµ Ð¸ÑÐ¿Ð¾Ð»ÑÐ·Ð¾Ð²Ð°Ð»Ð¸ÑÑ Ð² ÑÐ°Ð·ÑÐ°Ð±Ð¾ÑÐºÐµ Ð¡Ð¸ÑÑÐµÐ¼Ð° ÑÐ°Ð·Ð´ÐµÐ»ÐµÐ½Ð° Ð½Ð° 2 Ð¾ÑÐ´ÐµÐ»ÑÐ½ÑÑ Ð¿ÑÐ¸Ð»Ð¾Ð¶ÐµÐ½Ð¸Ñ. ÐÐµÑÐ²Ð¾Ðµ Ð¸ Ð¾ÑÐ½Ð¾Ð²Ð½Ð¾Ðµ â Ð±Ð¾Ñ, Ð¿Ð¾Ð·Ð²Ð¾Ð»ÑÑÑÐ¸Ð¹ Ð²Ð¾ÑÐ¿ÑÐ¾Ð¸Ð·Ð²Ð¾Ð´Ð¸ÑÑ Ð¼ÐµÐ´Ð¸Ð° ÐºÐ¾Ð½ÑÐµÐ½Ñ Ð² Ð¿ÑÐ¾Ð³ÑÐ°Ð¼Ð¼Ðµ Discord, ÐºÐ°Ðº Ð¸Ð· Ð¾ÑÐºÑÑÑÑÑ Ð¸ÑÑÐ¾ÑÐ½Ð¸ÐºÐ¾Ð² (Ð½Ð°Ð¿ÑÐ¸Ð¼ÐµÑ, YouTube, SoundCloud Ð¸ Ð¿Ð¾Ð´Ð¾Ð±Ð½ÑÑ), ÑÐ°Ðº Ð¸ Ð¸Ð· ÑÐ¾ÑÑÐ°Ð½ÑÐ½Ð½ÑÑ Ð·Ð°ÑÐ°Ð½ÐµÐµ Ð½Ð° Ð»Ð¾ÐºÐ°Ð»ÑÐ½Ð¾Ð¼, Ð´Ð»Ñ Ð±Ð¾ÑÐ°, Ð´Ð¸ÑÐºÐµ. ÐÑÐ¾ÑÐ¾Ðµ - Ð´Ð¾Ð¿Ð¾Ð»Ð½ÑÑÑÐµÐµ ÑÑÐ½ÐºÑÐ¸Ð¾Ð½Ð°Ð»ÑÐ½Ð¾ÑÑÑ Ð±Ð¾ÑÐ° Ð²ÐµÐ±-Ð¿ÑÐ¸Ð»Ð¾Ð¶ÐµÐ½Ð¸Ðµ, Ð¿Ð¾Ð·Ð²Ð¾Ð»ÑÑÑÐµÐµ Ð¿Ð¾Ð»ÑÐ·Ð¾Ð²Ð°ÑÐµÐ»Ñ ÑÐ¿ÑÐ°Ð²Ð»ÑÑÑ Ð»Ð¾ÐºÐ°Ð»ÑÐ½ÑÐ¼Ð¸ ÑÐ°Ð¹Ð»Ð°Ð¼Ð¸, ÐºÐ¾ÑÐ¾ÑÑÐµ Ð¼Ð¾Ð¶ÐµÑ Ð¸ÑÐ¿Ð¾Ð»ÑÐ·Ð¾Ð²Ð°ÑÑ Ð±Ð¾Ñ Ð² ÑÐ²Ð¾ÐµÐ¹ ÑÐ°Ð±Ð¾ÑÐµ. Ð Ð¸Ð¼ÐµÐ½Ð½Ð¾, Ð¿Ð¾Ð»ÑÐ·Ð¾Ð²Ð°ÑÐµÐ»Ñ, ÑÐµÑÐµÐ· Ð²ÐµÐ± Ð¸Ð½ÑÐµÑÑÐµÐ¹Ñ, Ð¼Ð¾Ð¶ÐµÑ Ð¿ÑÐ¾Ð¸Ð·Ð²Ð¾Ð´Ð¸ÑÑ Ð¾ÑÐ½Ð¾Ð²Ð½Ð¾Ð¹ Ð½Ð°Ð±Ð¾Ñ Ð¾Ð¿ÐµÑÐ°ÑÐ¸Ð¹ Ñ ÑÐ°Ð¹Ð»Ð°Ð¼Ð¸ (ÑÐ¾Ð·Ð´Ð°Ð½Ð¸Ðµ, ÑÐ´Ð°Ð»ÐµÐ½Ð¸Ðµ, ÑÐµÐ´Ð°ÐºÑÐ¸ÑÐ¾Ð²Ð°Ð½Ð¸Ðµ Ð¸ Ð¿ÑÐ¾ÑÐ¼Ð¾ÑÑ) Ð² ÑÑÐ¾Ð¹ Ð´Ð¸ÑÐµÐºÑÐ¾ÑÐ¸Ð¸ ÐÐ»Ñ Ð½Ð°Ð¿Ð¸ÑÐ°Ð½Ð¸Ñ ÑÐµÑÐ²ÐµÑÐ½Ð¾Ð¹ ÑÐ°ÑÑÐ¸ Ð±Ð¾ÑÐ° Ð¸ÑÐ¿Ð¾Ð»ÑÐ·Ð¾Ð²Ð°Ð»ÑÑ ÑÐ·ÑÐº JavaScript Ð¸ ÑÑÐµÐ¹Ð¼Ð²Ð¾ÑÐº Discord.js Ñ Ð±Ð¸Ð±Ð»Ð¸Ð¾ÑÐµÐºÐ¾Ð¹ Discord-Player, ÐºÐ¾ÑÐ¾ÑÑÐµ ÑÐ¿ÑÐ¾ÑÐ°ÑÑ Ð¸ ÑÑÐºÐ¾ÑÑÑÑ ÑÐ°Ð±Ð¾ÑÑ Ð½ÐµÐ¿Ð¾ÑÑÐµÐ´ÑÑÐ²ÐµÐ½Ð½Ð¾ Ñ Discord API. Ð¡Ð°Ð¹Ñ, Ð¿ÑÐµÐ´ÑÑÐ°Ð²Ð»ÑÑÑÐ¸Ð¹ ÑÐ¾Ð±Ð¾Ð¹ Ð²ÐµÐ±-Ð¿ÑÐ¸Ð»Ð¾Ð¶ÐµÐ½Ð¸Ðµ Ñ ÐºÐ»Ð¸ÐµÐ½Ñ-ÑÐµÑÐ²ÐµÑÐ½Ð¾Ð¹ Ð°ÑÑÐ¸ÑÐµÐºÑÑÑÐ¾Ð¹, Ð½Ð°Ð¿Ð¸ÑÐ°Ð½ Ð½Ð° ÑÐ·ÑÐºÐµ TypeScript Ñ Ð¸ÑÐ¿Ð¾Ð»ÑÐ·Ð¾Ð²Ð°Ð½Ð¸ÐµÐ¼ ÑÑÐµÐ¹Ð¼Ð²Ð¾ÑÐºÐ° NextJS, Ð¾Ð±Ð¼ÐµÐ½ Ð´Ð°Ð½Ð½ÑÐ¼Ð¸ Ð¿ÑÐ¾Ð¸Ð·Ð²Ð¾Ð´Ð¸ÑÑÑ Ð¿Ð¾ÑÑÐµÐ´ÑÑÐ²Ð¾Ð¼ ÑÐµÑÐ¸Ð°Ð»Ð¸Ð·Ð°ÑÐ¸Ð¸ Ð¸Ñ Ð² ÑÐ¾ÑÐ¼Ð°Ñ JSON. ÐÐ»Ñ ÑÑÐ°Ð½ÐµÐ½Ð¸Ñ Ð´Ð°Ð½Ð½ÑÑ Ð¿Ð¾Ð»ÑÐ·Ð¾Ð²Ð°ÑÐµÐ»Ñ Ð¸ÑÐ¿Ð¾Ð»ÑÐ·ÑÐµÑÑÑ Ð¡Ð£ÐÐ PostgreSQL.
description: The purpose of the work is to create an audio bot for playing media files in the Discord program, along with a website for administering and managing files for playback. This system will simplify online learning in a remote work environment and improve the quality of the taught material, through more extensive opportunities for students to listen. Tasks that were solved during the work: 1. Accessing the Discord API 2. Software architecture was developed; 3. The website for administration was designed and developed; 4. Selected technologies that were used in the development. The system is divided into 2 separate applications. The first and main thing is a bot that allows you to play media content in the Discord program, both from open sources (for example, YouTube, SoundCloud, and the like), and from previously saved on a local disk for the bot. The second is a web application that complements the bots functionality, allowing the user to manage local files that the bot can use in its work. Namely, the user, through the web interface, can perform a basic set of operations with files (creation, deletion, editing and viewing) in this directory The JavaScript language and the Discord.js framework were used to write the server part of the bot with the Discord-Player library, which simplify and speed up work directly with the Discord API. The site, which is a web application with a client-server architecture, is written in TypeScript using the NextJS framework, data is exchanged by serializing them into JSON format. The PostgreSQL DBMS is used to store user data.