Wick бот дискорд команды
Начнём. Ссылка на мой youtube канал.
Discord bot туториал. Туториал по созданию ботов для дискорда на node.js используя discord.js.
Creation date : 06.12.2019
Давайте начнём создание бота. Если у вас установлена node.js, то пропустите сделающие 2 строчки. Заходим на сайт node.js, скачиваем, устанавливаем. Скриншотов процесса установки нету, тк переустанавливать node.js нету желания. Но там всё интуитивно понятно.
Создание файлов, инициализация проекта, установка библиотек.
Создаём папку bot. Желательно не использовать кирилицу, юникод и т. п. в названии. Сразу же создаём файл index.js или bot.js. Это не несёт особого смысла. Можно назвать как угодно, но принятно index.js / bot.js. Это будет главный файл бота, т.е. первым запускается, в нём основной код бота. Далее открываем консоль / терминал если у вас linux. Для быстрого открытия консоли на windows можно нажать WIN + R, ввести cmd. Далее переходим в папку бота, думаю как это сделать через консоль всем понятно. Пишим : npm init - инициализация проекта. Жмём enter до конца. Если ошибка в package name, то напишите bot. npm i discord.js - установка библиотеки discord.js.
Далее рекомендую установить один из следующих редакторов кода :
Если очень слабый компьюер можете поставить notepad++, но это для постоянной основы не самый хороший вариант. Лично я использую Atom.
Вы можете зарегистрировать его на сайте discord developers. Жмём кнопку "New Application". Вводим название бота. Жмём "Create". Переходим во вкладку "Bot", нажимаем "Add Bot", затем "Yes, do it!" Находим строку "token", немного ниже есть кнопка "Copy", нажимаем. Теперь в вашем буфере обмена есть токен бота.
Создадим первый код. Пишем :
Открываем консоль, переходим в папку проекта и пишем :
в зависимости от названия файла. Если у вас windows, то вы можете создать файл start.bat с текстом
Если линукс, то вы можете создать файл start.sh
Это будет запускать бота. Далее я не буду говорить про запуск. Делайте это сами.
Создаем файл config.json с конфигурацией нашего бота.
В начале кода бота напишем :
Еще вы можете создать конфиг прямо в коде бота.
Но второй вариант крайне не рекомендуется использовать, ведь для того что-бы изменить конфиг бота нам придется изменять его код.
Давайте залогируем тег автора.
Также можно писать не
.startsWith проверят начинается ли строка с символов в аргументах.
Также даже начинающим программистам будет очень полезна в боте команда !eval для выполнения кода не пиша его в коде бота, т.е. вы пишите !eval какой-то код и бот выполняет этот код.
Я нашёл хороший туториал по этой команде на github. Рекомендую ознакомиться и взять себе команду в код бота. Принцип её работы мы разберём позже. Тык.
Это называется RichEmbed (Embed). Давайте отправим простой эмбед похожий на данный. (Картинка ниже)
Для этого создадим новую команду !ping .
В Embed есть много различных параметров, вы можете прочесть их далее, либо посмотреть на оффициальном сайте discord.js
Давайте сделаем команду для получения информации о пользователе. Команда взята из моего бота. Будем использовать библиотеку moment.js , устанавливаем npm i moment.js
Мой дискорд сервер!
Прошу зайти на мой дискорд сервер, ведь я долго делал туториал, а вам не сложно зайти на мой сервер в виде благодарности.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
The Best Anti Nuke: Wick is the very first bot on Discord that came up with the anti nuke concept. And it has been perfected over time and now it’s an absolute beast. Wick will stop admins/mods from: Mass-Channel Creations and Deletions, Mass-Role Creations and Deletions, Mass Kickin and Banning! (+ Mass-Webhook Creations and Deletions, Mass-Emojis Creations and Deletions for premium). You will also be able to tweak the anti nuke filters to your liking! PS: The anti nuke is actually free!!
Solid Anti Spam: Wick comes with an advanced anti spam that’s based on heat algorithms. It’s very efficient at stopping spammers and raiders without harming your regular members! It also comes with many filters that you can tweak to your own. You will basically make your own anti spam.
Verification: Wick will verify any (or only suspicious) member joining your server. They will need to go through our own special verification method! [Check Below]
Advanced yet easy moderation tools: Wick comes with the normal moderation tools. Yet, they are both very advanced and very easy to use. You won’t need moderation bot when you have Wick!
Join Gate: You can enable some filters that will work when a user joins, you can block accounts that have no avatars from joining, you can block new accounts. And you get to tweak the little details too!
And a lot more to mention.
. info
You should read the documentation if you want to ensure a proper setup:
Setup Guide
Quick Setup: Once you add Wick to your server, Put it’s role above roles you want to monitor and then type in the command [[w!setup]] and let Wick do 80% of the setup by itelf.
==It’s better to give 5 minutes of your time to read the full setup however, you can use w!help anytime.==
Anti Nuke:
Wick will monitor your server 24/7 for any abnormal behaviour from your admins and moderators and will react instantly if something bad happens. It 100% secures the most dangerous ways of nuking.
- Anti Nuke: Wick will track any action made by an admin and will punish them the moment they do something weird.
Efficient Join Gate:
When a member joins your server, multiple barriers come into play:
- Verification: Members joining need to first pass Wick’s captcha before they can enter and chat in the server. Wick has a unique verification method!
No Avatar Accounts: You can make Wick mute/kick/ban members with no custom profile pictures the moment they join.
Account Ages: You can make Wick mute/kick/ban members who have new accounts, you get to choose the number of minimum days required for an account!
- Bot Additions (Premium): You can mute/kick/ban any bot added by an unauthorized admin! Only people you choose can add bots!
Anti Spam and Raid:
Wick uses a special heat algorithm that will help you fight spammers without harming your regular members. It will silence any member trying to disturb your channels by spamming messages, spamming @mentions or sending Invite Links and a lot more!
- Heat System: Wick comes with a smart algorithm that tracks what members are sending. It will silence them temporarily if they show any abnormal behaviour. It’s very effective and it won’t piss off your regular members.
- Webhook Coverage: You can make Wick also target webhooks. Webhooks are the most dangerous way to raid your server endlessly. Wick puts an end to that.
Timed Mutes: Wick will silence members temporarily without the need of a moderator or a staff to unmute the punished member. The silence period also increases if the member decides to do it’s bad thing everytime they are muted!
Efficient Filters: Wick monitors: Message Similiarity, Emojis Spam, Inactive Channel Spam, Text Walls Spam, Emojis Spam, Mentions and more!
Best Moderation Commands:
Wick comes with awesome moderation commands that will allow you to moderate in any way you want. You can temporary mute and ban, you can hack ban and even hack mute, you can target people with no avatars, you can specify the reason. You can purge in the most customizability possible and more!
Quarantine Hold
No one will be able to help bad admins escape! When an admin tries to nuke your server, they are instantly added to the Quarantine where they have absolutely zero power. Wick will also keep an eye on the quarantined admin. No one can help them get out except for you and your trusted admins!
Wick will prevent ANY WAY possible that can give power to quarantined people.
Awesome Settings Commands:
Wick makes sure to provide the easiest way to set things. But, it doesn’t eliminate any advanced settings too! All Wick’s settings commands are enhanced.
Detailed Logging:
Wick will log anything it does in the most detailed way possible!
Panels
We made sure to make Wick the most aesthetic bot on Discord! All commands’ panels will be displayed beautifully in a way that helps.
- Anti Nuke Panic Mode: Once Wick senses something weird, it will instantly lockdown the entire server and then run a complete scan. It will also restore anything that was gone.
Backups: Wick will take a full snippet of your server and stores it just in case something bad happens, the backup covers: All channels and categories with all permissions, All roles with their permissions, your server’s general settings, your webhooks (to eliminate what doesn’t match) and even your emojis!
Restore System: When a nuke attempt happens, Wick will load the latest backup found where only things affected are restored and everything that doesn’t exist in the backup is deleted. Your server will be like it never faced anything bad!
Bot Additions: You can mute/kick/ban any bot added by an unauthorized admin! Only people you choose can add bots! This is very effective!
- Quarantine Strict Mode: You can make Wick punish your admins if they try to add a dangerous permission to ANY role in your server. If you finished setting up your server, enabling this is very awesome because no one will be able to mess around anymore!
Heat Panic Mode: When a raid starts, Wick will instantly start muting anyone that fits the criteria of a raider. It won’t touch your regular members! and it will last for a period of time before releasing the panic mode.
Join Raid: Wick will monitor ALL members joining your server. And it will also track all the invites in your server and which are being used. If an abnormal join behaviour is displayed, Wick will instantly punish everyone involved and will try to delete the invite links acting as a gateway to these raiders.
Prune Protection: With Wick and a main role, say goodbye to pruning.
And a lot more to cover! What are you waiting for? Try Wick out now!
You can vote once every 12 hours.
Once you press Upvote, you may be prompted asking if you wish to recieve notifications.
This will remind you in 12 hours that you can vote again!
Looking to promote your discord server? Check out Discord Server List!
The Best Anti Nuke: Wick is the very first bot on Discord that came up with the anti nuke concept. And it has been perfected over time and now it’s an absolute beast. Wick will stop admins/mods from: Mass-Channel Creations and Deletions, Mass-Role Creations and Deletions, Mass Kickin and Banning! (+ Mass-Webhook Creations and Deletions, Mass-Emojis Creations and Deletions for premium). You will also be able to tweak the anti nuke filters to your liking! PS: The anti nuke is actually free!!
Solid Anti Spam: Wick comes with an advanced anti spam that’s based on heat algorithms. It’s very efficient at stopping spammers and raiders without harming your regular members! It also comes with many filters that you can tweak to your own. You will basically make your own anti spam.
Verification: Wick will verify any (or only suspicious) member joining your server. They will need to go through our own special verification method! [Check Below]
Advanced yet easy moderation tools: Wick comes with the normal moderation tools. Yet, they are both very advanced and very easy to use. You won’t need moderation bot when you have Wick!
Join Gate: You can enable some filters that will work when a user joins, you can block accounts that have no avatars from joining, you can block new accounts. And you get to tweak the little details too!
And a lot more to mention.
. info
You should read the documentation if you want to ensure a proper setup:
Setup Guide
Quick Setup: Once you add Wick to your server, Put it’s role above roles you want to monitor and then type in the command [[w!setup]] and let Wick do 80% of the setup by itelf.
==It’s better to give 5 minutes of your time to read the full setup however, you can use w!help anytime.==
Anti Nuke:
Wick will monitor your server 24/7 for any abnormal behaviour from your admins and moderators and will react instantly if something bad happens. It 100% secures the most dangerous ways of nuking.
- Anti Nuke: Wick will track any action made by an admin and will punish them the moment they do something weird.
Efficient Join Gate:
When a member joins your server, multiple barriers come into play:
- Verification: Members joining need to first pass Wick’s captcha before they can enter and chat in the server. Wick has a unique verification method!
No Avatar Accounts: You can make Wick mute/kick/ban members with no custom profile pictures the moment they join.
Account Ages: You can make Wick mute/kick/ban members who have new accounts, you get to choose the number of minimum days required for an account!
- Bot Additions (Premium): You can mute/kick/ban any bot added by an unauthorized admin! Only people you choose can add bots!
Anti Spam and Raid:
Wick uses a special heat algorithm that will help you fight spammers without harming your regular members. It will silence any member trying to disturb your channels by spamming messages, spamming @mentions or sending Invite Links and a lot more!
- Heat System: Wick comes with a smart algorithm that tracks what members are sending. It will silence them temporarily if they show any abnormal behaviour. It’s very effective and it won’t piss off your regular members.
- Webhook Coverage: You can make Wick also target webhooks. Webhooks are the most dangerous way to raid your server endlessly. Wick puts an end to that.
Timed Mutes: Wick will silence members temporarily without the need of a moderator or a staff to unmute the punished member. The silence period also increases if the member decides to do it’s bad thing everytime they are muted!
Efficient Filters: Wick monitors: Message Similiarity, Emojis Spam, Inactive Channel Spam, Text Walls Spam, Emojis Spam, Mentions and more!
Best Moderation Commands:
Wick comes with awesome moderation commands that will allow you to moderate in any way you want. You can temporary mute and ban, you can hack ban and even hack mute, you can target people with no avatars, you can specify the reason. You can purge in the most customizability possible and more!
Quarantine Hold
No one will be able to help bad admins escape! When an admin tries to nuke your server, they are instantly added to the Quarantine where they have absolutely zero power. Wick will also keep an eye on the quarantined admin. No one can help them get out except for you and your trusted admins!
Wick will prevent ANY WAY possible that can give power to quarantined people.
Awesome Settings Commands:
Wick makes sure to provide the easiest way to set things. But, it doesn’t eliminate any advanced settings too! All Wick’s settings commands are enhanced.
Detailed Logging:
Wick will log anything it does in the most detailed way possible!
Panels
We made sure to make Wick the most aesthetic bot on Discord! All commands’ panels will be displayed beautifully in a way that helps.
- Anti Nuke Panic Mode: Once Wick senses something weird, it will instantly lockdown the entire server and then run a complete scan. It will also restore anything that was gone.
Backups: Wick will take a full snippet of your server and stores it just in case something bad happens, the backup covers: All channels and categories with all permissions, All roles with their permissions, your server’s general settings, your webhooks (to eliminate what doesn’t match) and even your emojis!
Restore System: When a nuke attempt happens, Wick will load the latest backup found where only things affected are restored and everything that doesn’t exist in the backup is deleted. Your server will be like it never faced anything bad!
Bot Additions: You can mute/kick/ban any bot added by an unauthorized admin! Only people you choose can add bots! This is very effective!
- Quarantine Strict Mode: You can make Wick punish your admins if they try to add a dangerous permission to ANY role in your server. If you finished setting up your server, enabling this is very awesome because no one will be able to mess around anymore!
Heat Panic Mode: When a raid starts, Wick will instantly start muting anyone that fits the criteria of a raider. It won’t touch your regular members! and it will last for a period of time before releasing the panic mode.
Join Raid: Wick will monitor ALL members joining your server. And it will also track all the invites in your server and which are being used. If an abnormal join behaviour is displayed, Wick will instantly punish everyone involved and will try to delete the invite links acting as a gateway to these raiders.
Prune Protection: With Wick and a main role, say goodbye to pruning.
And a lot more to cover! What are you waiting for? Try Wick out now!
The Best Anti Nuke: Wick is the very first bot on Discord that came up with the anti nuke concept. And it has been perfected over time and now it's an absolute beast. Wick will stop admins/mods from: Mass-Channel Creations and Deletions, Mass-Role Creations and Deletions, Mass Kickin and Banning! (+ Mass-Webhook Creations and Deletions, Mass-Emojis Creations and Deletions for premium). You will also be able to tweak the anti nuke filters to your liking! PS: The anti nuke is actually free!!
Solid Anti Spam: Wick comes with an advanced anti spam that's based on heat algorithms. It's very efficient at stopping spammers and raiders without harming your regular members! It also comes with many filters that you can tweak to your own. You will basically make your own anti spam.
Verification: Wick will verify any (or only suspicious) member joining your server. They will need to go through our own special verification method! [Check Below]
Advanced yet easy moderation tools: Wick comes with the normal moderation tools. Yet, they are both very advanced and very easy to use. You won't need moderation bot when you have Wick!
Join Gate: You can enable some filters that will work when a user joins, you can block accounts that have no avatars from joining, you can block new accounts. And you get to tweak the little details too!
And a lot more to mention.
You should read the documentation if you want to ensure a proper setup:
Setup Guide
Quick Setup: Once you add Wick to your server, Put it's role above roles you want to monitor and then type in the command w!setup and let Wick do 80% of the setup by itelf.
It's better to give 5 minutes of your time to read the full setup however, you can use w!help anytime.
Anti Nuke:
Wick will monitor your server 24/7 for any abnormal behaviour from your admins and moderators and will react instantly if something bad happens. It 100% secures the most dangerous ways of nuking.
- Anti Nuke: Wick will track any action made by an admin and will punish them the moment they do something weird.
Efficient Join Gate:
When a member joins your server, multiple barriers come into play:
- Verification: Members joining need to first pass Wick's captcha before they can enter and chat in the server. Wick has a unique verification method!
No Avatar Accounts: You can make Wick mute/kick/ban members with no custom profile pictures the moment they join.
Account Ages: You can make Wick mute/kick/ban members who have new accounts, you get to choose the number of minimum days required for an account!
- Bot Additions (Premium): You can mute/kick/ban any bot added by an unauthorized admin! Only people you choose can add bots!
Anti Spam and Raid:
Wick uses a special heat algorithm that will help you fight spammers without harming your regular members. It will silence any member trying to disturb your channels by spamming messages, spamming @mentions or sending Invite Links and a lot more!
- Heat System: Wick comes with a smart algorithm that tracks what members are sending. It will silence them temporarily if they show any abnormal behaviour. It's very effective and it won't piss off your regular members.
- Webhook Coverage: You can make Wick also target webhooks. Webhooks are the most dangerous way to raid your server endlessly. Wick puts an end to that.
Timed Mutes: Wick will silence members temporarily without the need of a moderator or a staff to unmute the punished member. The silence period also increases if the member decides to do it's bad thing everytime they are muted!
Efficient Filters: Wick monitors: Message Similiarity, Emojis Spam, Inactive Channel Spam, Text Walls Spam, Emojis Spam, Mentions and more!
Best Moderation Commands:
Wick comes with awesome moderation commands that will allow you to moderate in any way you want. You can temporary mute and ban, you can hack ban and even hack mute, you can target people with no avatars, you can specify the reason. You can purge in the most customizability possible and more!
Quarantine Hold
No one will be able to help bad admins escape! When an admin tries to nuke your server, they are instantly added to the Quarantine where they have absolutely zero power. Wick will also keep an eye on the quarantined admin. No one can help them get out except for you and your trusted admins! Wick will prevent ANY WAY possible that can give power to quarantined people.
Awesome Settings Commands:
Wick makes sure to provide the easiest way to set things. But, it doesn't eliminate any advanced settings too! All Wick's settings commands are enhanced.
Detailed Logging:
Wick will log anything it does in the most detailed way possible!
Panels
We made sure to make Wick the most aesthetic bot on Discord! All commands' panels will be displayed beautifully in a way that helps.
- Anti Nuke Panic Mode: Once Wick senses something weird, it will instantly lockdown the entire server and then run a complete scan. It will also restore anything that was gone.
Backups: Wick will take a full snippet of your server and stores it just in case something bad happens, the backup covers: All channels and categories with all permissions, All roles with their permissions, your server's general settings, your webhooks (to eliminate what doesn't match) and even your emojis!
Restore System: When a nuke attempt happens, Wick will load the latest backup found where only things affected are restored and everything that doesn't exist in the backup is deleted. Your server will be like it never faced anything bad!
Bot Additions: You can mute/kick/ban any bot added by an unauthorized admin! Only people you choose can add bots! This is very effective!
- Quarantine Strict Mode: You can make Wick punish your admins if they try to add a dangerous permission to ANY role in your server. If you finished setting up your server, enabling this is very awesome because no one will be able to mess around anymore!
Heat Panic Mode: When a raid starts, Wick will instantly start muting anyone that fits the criteria of a raider. It won't touch your regular members! and it will last for a period of time before releasing the panic mode.
Join Raid: Wick will monitor ALL members joining your server. And it will also track all the invites in your server and which are being used. If an abnormal join behaviour is displayed, Wick will instantly punish everyone involved and will try to delete the invite links acting as a gateway to these raiders.
Prune Protection: With Wick and a main role, say goodbye to pruning.
And a lot more to cover! What are you waiting for? Try Wick out now!
In this section you'll learn how to use the button components.
Button Style
Buttons can have different styles (background colors etc.) Here are all possible values for style function argument.
Note: if link style is used, the button won't send any interactions!
Style examples
The image was taken from Discord Docs
Button types
There are 2 types of buttons: interactive and link .
When an interactive button is pressed it sends an interaction which can be used together with $onInteraction[ID] . Every interactive button has an ID . If you create $onInteraction[ID] callback, it will get triggered when the button with the same ID is pressed. Interactive buttons can use every style except link .
Link buttons don't send any interactions. When they're pressed they forward the user to a website. Link buttons have to set their style argument value to link .
Adding a button
Buttons can be added to a new message or already existing message.
$addButton[new row (yes/no);interaction ID or url;label;style;disabled (yes/no);emoji (leave empty if not needed);messageID(optional)]
Function arguments breakdown
- new row - if set to yes the button will appear in a new row. If it's set to no the button will appear in the same row as a previous button. Check examples below.
- interaction ID or url - depending on a button type, you either set it to interactionID which is then used in $onInteraction[ID] callback or URL if it's link button.
- label - it's the text value visible on a button
- style - it's used to specify the button's background color. If the button has a link/url you have to set this to link . Check this section for more details.
- disabled - if set to yes the button can't be pressed
- emoji - this can be left empty (it has to be provided but it can be empty) if you don't want emoji inside the button. Emojis have to be either pasted as unicode or be in this format <:emoji name:emoji ID>
- messageID - this field is optional which means it doesn't has to be provided. When it's provided the buttons will be added to a provided message and not to the current one. It's important to note that the message author has to be the bot.
Editing a button
$editButton[buttonID or URL;label;style;disabled (yes/no);emoji (leave empty if not needed);messageID(optional)]
Arguments work exactly the same way as in $addButton function. buttonID or URL is used for finding the button.
Removing buttons
There are two functions for this.
- $removeButtons - removes buttons from the current message
- $removeButtons[messageID] - removed button from the provided message
Code Examples
Creating a simple interactive button
Note: the last argument in $addButton is empty because we don't want emojis for this example
Creating $onInteraction[] callback
Note: ID provided in $onInteraction[] is the same as the one provided in $addButton[] from this section
Note: In the $addButton[] I used yes for the new row argument so the button would appear in the next row. Check the results below.
Читайте также: