Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

discord js check if person banned

// Async context needed for 'await' (meaning this must be within an async function).
// Assuming 'message' is a Message within the guild.

try {
  const banList = await message.guild.fetchBans();

  const bannedUser = banList.find(user => user.id === 'someID');

  if (bannedUser) await message.channel.send(`${bannedUser.tag} is banned.`);
  else await message.channel.send('That user is not banned.');
} catch(err) {
  console.error(err);
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: moment time ago format reactjs 
Javascript :: react native app crashes without error 
Javascript :: bootstrap modal clear all fields 
Javascript :: javascript on keypu 
Javascript :: smooth link to anchor js 
Javascript :: javascript tolocaletimestring 
Javascript :: new line in p tag react 
Javascript :: js conditional object 
Javascript :: nodejs aws s3 stream upload 
Javascript :: jquery select2 how to make dont close after select 
Javascript :: jquery on change 
Javascript :: convert date time to date function javascript 
Javascript :: javascript absolute path 
Javascript :: how to access key of object in javascript 
Javascript :: add event listener in react useeffect 
Javascript :: add scss in next js 
Javascript :: three js render 
Javascript :: jquery replace html 
Javascript :: javascript generate random numbers 
Javascript :: window bind load jquery 
Javascript :: restfull api methods 
Javascript :: how to check all elements in array includes in another array javascript 
Javascript :: jquery get padding of element 
Javascript :: parent of heap node 
Javascript :: javascript loop over dictionary 
Javascript :: javascript pluck from array of objects 
Javascript :: vue 3 computed 
Javascript :: how to add js in flask 
Javascript :: javascript take last n elements of array 
Javascript :: detect a click outside an element javascript 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =