Tutorial 4 - Some errors in console when user with no rights try to kick someone
lZzozZl opened this issue · 1 comments
Hi. Im usually testing some cases when or after i watch your videos. One of the cases is when user without .hasPermission('MANAGE_MESSAGES') try to kick someone the line
if (!message.member.hasPermission('MANAGE_MESSAGES')) return message.channel.search('No can do pal!');
does not return message in the channel. Instead of it prints out message at console:
(node:12024) DeprecationWarning: TextBasedChannel#search: userbot methods will be removed
(node:12024) UnhandledPromiseRejectionWarning: DiscordAPIError: Bots cannot use this endpoint
at item.request.gen.end (C:\Users\xxxx\Desktop\DiscordBots\Project2501DiscordBot\node_modules\discord.js\src\client\rest\RequestHandlers\Sequential.js:79:15)
at then (C:\Users\xxxx\Desktop\DiscordBots\Project2501DiscordBot\node_modules\snekfetch\src\index.js:215:21)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:12024) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a
promise which was not handled with .catch(). (rejection id: 2)
(node:12024) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I notice that i was write search indtead of send.
Please close and delete issue :)