Skip to content

Natives (Members)

lp_ edited this page Nov 2, 2022 · 19 revisions

HomeNativesMembers

  • Parameters:
    • guildid: The Guild's ID with the target user in it.
    • memberid: The member's ID , to get the nick name from.
    • dest_string: The string destination (array) to store the member's nick name in.
  • Returns:
    • Always 1 on success, 0 on failure.

This function returns the users changeable "NickName" - NOT the Discord User account name.


  • Parameters:
    • guildid: The Guild with the target user in it.
    • memberid: The member's ID, to get the name from.
    • dest_string: The string destination (array) to store the member's name in.
  • Returns:
    • Always 1 on success, 0 on failure.

This returns the user's Discord Account name, which the user itself cannot change!


  • Parameters:
    • guildid: The Guild with the target user in it.
    • memberid: The member's ID, to get the discriminator from.
    • dest_string: The string destination (array) to store the member's discriminator in.
  • Returns:
    • Always 1 on success, 0 on failure.

With member discriminator is refered to their 'Username#0001' name.

  • Parameters:
    • guildid: The Guild with the target user in it.
    • memberid: The member's ID, to get the Avatar URL from.
    • dest_string: The string destination (array) to store the member's Avatar URL in.
  • Returns:
    • Always 1 on success, 0 on failure.

  • Parameters:
    • guildid: The Guild with the target user in it.
    • memberid: The member's ID, to get the discord-side 17-18 digit id.
    • dest_string: The string destination (array) to store the member's discord ID in.
  • Returns:
    • Always 1 on success, 0 on failure.

  • Parameters:
    • guildid: The Guild with the target user in it.
    • memberid: The id of the member to ban.
    • delete_messages_days: The amount of days worth of messages from this user to be deleted.
    • reason[]: The ban reason.
  • Returns:
    • Always 1 on success, 0 on failure. ⚠️ Currently untested, open an issue if it's not working!

  • Parameters:
    • guildid: The Guild with the target user in it.
    • memberid: The id of the member to unban.
  • Returns:
    • Always 1 on success, 0 on failure. ⚠️ Currently untested, open an issue if it's not working!

  • Parameters:
    • guildid: The Guild with the target user in it.
    • memberid: The id of the member to timeout.
    • seconds: The amount of seconds for the player to be timed out.
    • reason[]: The reason for the timeout.
  • Returns:
    • Always 1 on success, 0 on failure. ⚠️ Currently untested, open an issue if it's not working!

  • Parameters:
    • guildid: The Guild with the target user in it.
    • memberid: The id of the member to perform the role check.
    • role_name: The name of the role
  • Returns:
    • When used, this checks if the user has role_name as a granted discord role and return true. False if not granted.

  • Parameters:
    • guildid: The Guild with the target user in it.
    • memberid: The id of the member to give an role.
    • role_name: The name of the role to give.
  • Returns:
    • Returns true if successfully granted a user role permissions. And false if any errors occurred.

  • Parameters:
    • guildid: The Guild with the target user in it.
    • memberid: The id of the member to revoke the role.
    • role_name: The name of the role to revoke.
  • Returns:
    • Returns true if successfully revoked users role permissions. And false if any errors occurred.

  • Parameters:
    • userid: The id of the user to ban.
  • Returns:
    • This function bans a user from any bot interaction globally (returning true if succeeded). Works about 90% - Open an Issue if you found a bug. ℹ️ Bans are stored in the programs main directory in a file called bans.txt

  • Parameters:
    • userid: The id of the user to unban.
  • Returns:
    • This function unbans the user from all interaction with bot bot, globally. Returns true if succeeded. ℹ️ Bans are stored in the programs main directory in a file called bans.txt

  • Parameters:
    • userid: The id of the user to check for.
  • Returns:
    • Returns true if banned, false if not. ℹ️ Bans are stored in the programs main directory in a file called bans.txt

How it works (script-side ids):

On the bot's startup, all discord servers and their users are scanned for the first time. After everything has been retrieved, each discord server has an simple (just for this programs own use) integer ID applied.

This makes refering to discord guilds in natives easier.