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 :: ipinfo location javascript 
Javascript :: Shopify cart context 
Javascript :: convert snake case to camelcase javascript recursive 
Javascript :: react native password qwerty 
Javascript :: Get Error 
Javascript :: knex js how to group by many items 
Javascript :: node-fetch retry 
Javascript :: $() in javascript 
Javascript :: Sorting Array of String, Numbers or Objects in javascript 
Javascript :: javascript convert color string to rgb 
Javascript :: toggleplay button javascript 
Javascript :: javascript custom table 
Javascript :: javascript change favicon dynamicly 
Javascript :: react leaflet layer disable controls while on top 
Javascript :: inheritence in javascript 
Javascript :: get 3 random items from array javascript 
Javascript :: updating a random variable in a function 
Javascript :: stack overflow multiselect error react 
Javascript :: Ajax in wordpredss 
Javascript :: ohif add auth to config 
Javascript :: rotate image javascript base64 
Javascript :: .loads with whole json file 
Javascript :: (state.isLoggedIn = function() {return false}) react redux 
Javascript :: Nyadorera 
Javascript :: how to create your own event emitter in javascript 
Javascript :: angularjs No alignment and missing item in a vertical menu 
Javascript :: AngularJS disable default form submit hook 
Javascript :: Edit parameter in variable with increment/decrement box and save it 
Javascript :: coin gecko api 
Javascript :: How to access a preexisting collection with Mongoose 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =