Bans a user from this server.
 @param user [User, #resolve_id] The user to ban.
 @param message_days [Integer] How many days worth of messages sent by the user should be deleted.
 @param reason [String] The reason the user is being banned.
511521
def ban(user, message_days = 0, reason: nil)
      API::Server.ban_user(@bot.token, @id, user.resolve_id, message_days, reason)
    end
275343
public static function delete_message($messageid, $userid, $read = true) {
        global $CFG;

        // Check if private messaging between users is allowed.
        if (empty($CFG->messaging)) {
            throw new moodle_exception('disabled', 'message');
        }

        // Warnings array, it can be empty at the end but is mandatory.
        $warnings = array();

        // Validate params.
        $params = array(
            'messageid' => $messageid,
            'userid' => $userid,
            'read' => $read
        );
        $params = self::validate_parameters(self::delete_message_parameters(), $params);

        // Validate context.
        $context = context_system::instance();
        self::validate_context($context);

        $user = core_user::get_user($params['userid'], '*', MUST_EXIST);
        core_user::require_active_user($user);

        if (\core_message\api::can_delete_message($user->id, $params['messageid'])) {
            $status = \core_message\api::delete_message($user->id, $params['messageid']);
        } else {
            throw new moodle_exception('You do not have permission to delete this message');
        }

        $results = array(
            'status' => $status,
            'warnings' => $warnings
        );
        return $results;
    }
990722
def delete_user(self, user_id, **kwargs):
        
        return DeleteUser(settings=self.settings, **kwargs).call(user_id=user_id, **kwargs)
976310
async def ban_user(channel, user):
    

    data = datatools.get_data()
    server_id = channel.server.id

    try:
        await client.ban(user)
    except discord.errors.Forbidden:
        await client.send_typing(channel)
        embed = ui_embed.error(channel, "Ban Error", "I do not have the permissions to ban that person.")
        await embed.send()
        return

    # Set the user's warnings to 0
    if "warnings" in data["discord"]["servers"][server_id][_data.modulename]:
        if user.id in data["discord"]["servers"][server_id][_data.modulename]["warnings"]:
            data["discord"]["servers"][server_id][_data.modulename]["warnings"][user.id] = 0
            datatools.write_data(data)

    await client.send_typing(channel)
    embed = ui_embed.user_ban(channel, user)
    await embed.send()

    try:
        response = "You have been banned from the server '{}' " \
                   "contact the owners to resolve this issue.".format(channel.server.name)
        await client.send_message(user, response)
    except Exception as e:
        logger.exception(e)
1031601
def delete
      user = Cadenero::User.find_by_id(params[:id])
      if user_signed_in?
        env['warden'].logout(:user)
        render json: {message: "Successful logout"}, status: :ok
      else
        render json: {message: "Unsuccessful logout user with id"}, status: :forbidden
      end
    end
88930
def delete_users(user_list)
      raise ArgumentError unless user_list.is_a?(Array)
      validate_user_list(user_list)
      api.post('deleteUsers', user_list, 'application/json')
    end
722741
def delete_user(self, user):
        
        user_id = utils.get_id(user)
        uri = "users/%s" % user_id
        resp, resp_body = self.method_delete(uri)
        if resp.status_code == 404:
            raise exc.UserNotFound("User '%s' does not exist." % user)
        elif resp.status_code in (401, 403):
            raise exc.AuthorizationFailure("You are not authorized to delete "
                    "users.")
278984
function (reason, offendingMessage) {
    var self = this;
    var msg = {msg: 'error', reason: reason};
    if (offendingMessage)
      msg.offendingMessage = offendingMessage;
    self.send(msg);
  }
699845
def removeFriend(user)
      method = 'removeFriend'
      type = Boolean
      args = {:user=>user}
      return_object type,method,args,true
    end
1343844
def prj_remove_user(self, *args, **kwargs):
        
        if not self.cur_prj:
            return
        i = self.prj_user_tablev.currentIndex()
        item = i.internalPointer()
        if item:
            user = item.internal_data()
            log.debug("Removing user %s.", user.username)
            item.set_parent(None)
            self.cur_prj.users.remove(user)
3411
protected void doMessage(SipServletRequest request) throws 
            ServletException, IOException {

        request.createResponse(SipServletResponse.SC_OK).send();            

        Object message = request.getContent();
        String from = request.getFrom().getURI().toString();
        
        logger.info("from is "+ from);
        
        //A user asked to quit.
        if(message.toString().equalsIgnoreCase("/quit")) {
            sendToUser(from, "Bye");
            removeUser(from);
            return;
        }
        
        //Add user to the list
        if(!containsUser(from)) {
            sendToUser(from, "Welcome to chatroom " + serverAddress + 
                    ". Type '/quit' to exit.");
            addUser(from);
        }

        if(message.toString().equalsIgnoreCase("/who")) {
            String users = "List of users:\n";
            List<String> list = (List<String>)getServletContext().getAttribute(USER_LIST);
            for (String user : list) {
                users += user + "\n";
            }
            sendToUser(from, users);
//            removeUser(from);
            return;
        }

        //If the user is joining the chatroom silently, no message 
        //to broadcast, return. 
        if(message.toString().equalsIgnoreCase("/join")) {
            return;
        }
        
        //We could implement more IRC commands here, 
        //see http://www.mirc.com/cmds.html
        sendToAll(from, message, request.getHeader("Content-Type"));
	}
584654
def unfollow_user(self, user, delegate):
        
        parser = txml.Users(delegate)
        return self.__postPage('/friendships/destroy/%s.xml' % (user), parser)
1073375
def remove_user(self, user, **kwargs):
        """"""
        if isinstance(user, Entity):
            user = user['id']

        assert isinstance(user, six.string_types)

        endpoint = '{0}/{1}/users/{2}'.format(
            self.endpoint,
            self['id'],
            user,
        )
        return self.request('DELETE', endpoint=endpoint, query_params=kwargs)
130004
def prune_count(days)
      raise ArgumentError, 'Days must be between 1 and 30' unless days.between?(1, 30)

      response = JSON.parse API::Server.prune_count(@bot.token, @id, days)
      response['pruned']
    end
819338
def delete(options = {})
      options = options.merge(user_name: @name)
      resp = @client.delete_user(options)
      resp.data
    end
779803
public void setDaysExcluded (final boolean [] days)
  {
    if (days == null)
    {
      throw new IllegalArgumentException ("The days parameter cannot be null.");
    }

    if (days.length < MAX_DAYS_IN_MONTH)
    {
      throw new IllegalArgumentException ("The days parameter must have a length of at least " +
                                          MAX_DAYS_IN_MONTH +
                                          " elements.");
    }

    m_aExcludeDays = days;
    m_aExcludeAll = areAllDaysExcluded ();
  }
22037
def delete_message(self, message_id):
        
        return self.bot.api_call(
            "deleteMessage", chat_id=self.id, message_id=message_id
        )