Advertisement
Eta740

Arraybot Script Documentation

Jun 30th, 2018
642
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.75 KB | None | 0 0
  1. Last verified: Jul 21, 2018
  2. Source: Arraybot on Github
  3. 1) https://github.com/Arraying/Arraybot/blob/master/src/main/java/de/arraying/arraybot/manager/ScriptManager.java
  4. 2) https://github.com/Arraying/Arraybot/blob/master/src/main/java/de/arraying/arraybot/script/entity/ScriptGuild.java
  5. 3) https://github.com/Arraying/Arraybot/blob/master/src/main/java/de/arraying/arraybot/script/entity/ScriptTextChannel.java
  6. a) https://github.com/Arraying/Arraybot/blob/master/src/main/java/de/arraying/arraybot/script/abstraction/AbstractChannel.java
  7. 4) https://github.com/Arraying/Arraybot/blob/master/src/main/java/de/arraying/arraybot/script/entity/ScriptRole.java
  8. 5) https://github.com/Arraying/Arraybot/blob/master/src/main/java/de/arraying/arraybot/script/entity/ScriptUser.java
  9. a) https://github.com/Arraying/Arraybot/blob/master/src/main/java/de/arraying/arraybot/script/abstraction/AbstractMessenger.java
  10. 6) https://github.com/Arraying/Arraybot/blob/master/src/main/java/de/arraying/arraybot/script/entity/ScriptMessage.java
  11. 7) https://github.com/Arraying/Arraybot/blob/master/src/main/java/de/arraying/arraybot/script/method/EmbedMethods.java
  12. a) https://github.com/DV8FromTheWorld/JDA/blob/master/src/main/java/net/dv8tion/jda/core/EmbedBuilder.java
  13. b) https://github.com/DV8FromTheWorld/JDA/blob/master/src/main/java/net/dv8tion/jda/core/entities/MessageEmbed.java
  14. c) https://imgur.com/a/yOb5n
  15. 8) https://github.com/Arraying/Arraybot/blob/master/src/main/java/de/arraying/arraybot/script/method/CommandMethods.java
  16. a) https://github.com/Arraying/Arraybot/blob/master/src/main/kotlin/de/arraying/arraybot/command/CommandCollection.kt
  17. 9) https://github.com/Arraying/Arraybot/blob/master/src/main/java/de/arraying/arraybot/script/method/ManagerMethods.java
  18. 10) https://github.com/Arraying/Arraybot/blob/master/src/main/java/de/arraying/arraybot/script/method/StorageMethods.java
  19.  
  20.  
  21. *Everything is case sensitive
  22. *Guild = Discord server
  23. *Inherited methods will be marked by ">" at the start of the line
  24. *Methods which I don't fully understand will be marked by "*" at the start of the line
  25. *Getting a list of something returns a java array
  26. JS array methods will not work, but you can still access each element using indexes as usual
  27. You can loop through the array with for(x in arr) or for each(x in arr)
  28.  
  29. Import from pastebin/gist github (it will act like the entire page was copy-pasted, and everything in that page will be executed)
  30. If nesting imports, each file only gets imported once and all repeats are ignored
  31. #include [insert url raw here]
  32.  
  33. Script commands are evaluated internally inside a function, so you can stop a script mid-way via return
  34. =======================================================================================================================================
  35.  
  36. guild.<method> --> Return the thing being retrieved or null if it doesn't exist
  37. getID() - Get the ID of the guild
  38. getCreationTime() - Get the time of the guild's creation
  39. getName() - Get the name of the guild
  40. getIcon() - Get the icon URL of the guild
  41. getOwner() - Get the owner of the guild
  42. getTextChannels() - Get a list of all text channels in the guild
  43. getTextChannel("ID") - Get the specific text channel by its "ID"
  44. getVoiceChannels() - Get a list of all voice channels in the guild
  45. getvoiceChannel("ID") - Get the specific voice channel by its "ID"
  46. getUsers() - Get a list of all users in the guild
  47. getUser("ID") - Get the specific user by its "ID"
  48. getRoles() - Get a list of all roles in the guild
  49. getRole("ID") - Get the specific role by its "ID"
  50.  
  51. channel.<method> --> Return the thing being retrieved (unless specified otherwise)
  52. getID() - Get the ID of the channel
  53. message("string" or embed) - Send "string" as a text message or embed message into the channel --> Return undefined
  54. > getCreationTime() - Get the time of the channel's creation
  55. > createInvite() - Create an invite to the channel --> Return invite URL
  56. > delete() - Delete the channel --> Return undefined
  57. > getName() - Get the name of the channel
  58. >* getPosition() - Get the position of the channel (need to check if start is 0 or 1)
  59. > setBitrate(int) - Set the bitrate of the channel (voice channel only, 8000 ≤ int ≤ 96000) --> Return undefined
  60. > setName("string") - Set the name of the channel --> Return undefined
  61. > setNSFW(booleen) - Set the NSFW property of the channel --> Return undefined
  62. >* setPosition(int) - Set the position of the channel (acts weirdly depending on channel) --> Return undefined
  63. > setTopic("string") - Set the topic of the channel --> Return undefined
  64. > setUserLimit(int) - Set the user limit of the channel (voice channel only, 0 ≤ int ≤ 99) --> Return undefined
  65.  
  66. <role>.<method> --> Return the thing being retrieved (unless specified otherwise)
  67. *Role has to be gotten via other methods, like guild.getRole("ID")
  68. getID() - Get the ID of the role
  69. getCreationTime() - Get the time of the role's creation
  70. getName() - Get the name of the role
  71. getColor() - Get the color of the role in RGB (defaults to null)
  72. getPosition() - Get the position of the role (start on 0 from bottom of role list excluding "@everyone")
  73. isHoisted() - Check if the role is hoisted (displayed separately in user list) --> Return true/false
  74. isMentionable() - Check if the role is mentionable --> Return true/false
  75.  
  76. user.<method> --> Return the thing being retrieved (unless specified otherwise)
  77. getID() - Get the ID of the user
  78. getCreationTime() - Get the time of the user's creation
  79. getAvatar() - Get the avatar URL of the user
  80. getName() - Get the actual name of the user
  81. getNickname() - Get the nickname of the user (defaults to null instead of actual name)
  82. > message("string" or embed) - Send a DM containing "string" or embed to the user --> Return undefined
  83.  
  84. message.<method> --> Return the thing being retrieved (unless specified otherwise)
  85. getID() - Get the id of the message
  86. getCreationTime() - Get the time of the message's creation
  87. getUser() - Get the user that sent the message
  88. getChannel() - Get the channel in which the message was sent
  89. getContent() - Get the full content of the message
  90. getEditTime() - Get the time of (first? last?) edit made on the message
  91. getEmbeds() - Get the embeds of the message
  92. pin() - Toggle the pinned status of the message --> Return true/false (true = message got pinned)
  93. delete() - Delete the message --> Return undefined
  94.  
  95. embeds.<method> --> Return as specified
  96. *Refer to link7a for full list
  97. *Some of my experiments with embeds if they're of any help: https://pastebin.com/8nHaw9ej
  98. newEmbed() - Create a new embed builder --> Return embed builder
  99. canSend(embed or msg embed) - Check if the embed can be sent --> Return true/false
  100. -->embedbuilder.<method>
  101.  
  102.  
  103. commands.<method> --> Return undefined
  104. executeCommand("name",arg) - Execute the "name" command with optional [argument] (argument is a string array)
  105. *Name of command as listed in source link 8a
  106. *Dev-only commands: eval, reload, script, shards (and you can't cheat by calling on them via custom scripts)
  107.  
  108. manager.<method> --> Return true if successfully executed. False otherwise
  109. addRole(user,role) - Add role to user
  110. removeRole(user,role) - Remove role from user
  111. kick(user) - Kick user from the guild
  112. ban(user) - Ban user from the guild
  113. nickname(user,"name") - Change user nickname to "name"
  114.  
  115. storage.<method> --> Return as specified
  116. *Storages are like persistent variables that store string only. Non premium(?) guild can store up to 5000
  117. get("key") - Get the specific stored value via "key" (defaults to "null" as a string)
  118. set("key",value) - Set a stored value as string with "key" --> Return value
  119. delete("key") - Delete the specific stored value via "key" --> Return undefined
  120. getKeys() - Get the list of keys used in the guild
  121.  
  122. time --> Return current time in ISO 8601 format in UTC
  123. [YYYY]-[MM]-[DD]T[HH]:[MM]:[SS].[mmm]Z
  124. T separates date from time, Z represent UTC timezone
  125. If you just need to compute time difference, javascript's Date.now() might be better
  126.  
  127. =======================================================================================================================================
  128. Examples
  129. General storage key management and tracking: https://gist.github.com/Eta740/e8b4052440abb7f789302169b363dba3
  130. Evaluate JS code: https://gist.github.com/Eta740/8bbfd76e8e4883e4d6eb8cb18c65e629
  131. Google Search: https://gist.github.com/Eta740/e18030a612c7ad2346bf1619d2af68af
  132. Color text with syntax highlighting: https://gist.github.com/Eta740/712b6442a9cddd9d030deb78e550144b
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement