Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Last verified: Jul 21, 2018
- Source: Arraybot on Github
- 1) https://github.com/Arraying/Arraybot/blob/master/src/main/java/de/arraying/arraybot/manager/ScriptManager.java
- 2) https://github.com/Arraying/Arraybot/blob/master/src/main/java/de/arraying/arraybot/script/entity/ScriptGuild.java
- 3) https://github.com/Arraying/Arraybot/blob/master/src/main/java/de/arraying/arraybot/script/entity/ScriptTextChannel.java
- a) https://github.com/Arraying/Arraybot/blob/master/src/main/java/de/arraying/arraybot/script/abstraction/AbstractChannel.java
- 4) https://github.com/Arraying/Arraybot/blob/master/src/main/java/de/arraying/arraybot/script/entity/ScriptRole.java
- 5) https://github.com/Arraying/Arraybot/blob/master/src/main/java/de/arraying/arraybot/script/entity/ScriptUser.java
- a) https://github.com/Arraying/Arraybot/blob/master/src/main/java/de/arraying/arraybot/script/abstraction/AbstractMessenger.java
- 6) https://github.com/Arraying/Arraybot/blob/master/src/main/java/de/arraying/arraybot/script/entity/ScriptMessage.java
- 7) https://github.com/Arraying/Arraybot/blob/master/src/main/java/de/arraying/arraybot/script/method/EmbedMethods.java
- a) https://github.com/DV8FromTheWorld/JDA/blob/master/src/main/java/net/dv8tion/jda/core/EmbedBuilder.java
- b) https://github.com/DV8FromTheWorld/JDA/blob/master/src/main/java/net/dv8tion/jda/core/entities/MessageEmbed.java
- c) https://imgur.com/a/yOb5n
- 8) https://github.com/Arraying/Arraybot/blob/master/src/main/java/de/arraying/arraybot/script/method/CommandMethods.java
- a) https://github.com/Arraying/Arraybot/blob/master/src/main/kotlin/de/arraying/arraybot/command/CommandCollection.kt
- 9) https://github.com/Arraying/Arraybot/blob/master/src/main/java/de/arraying/arraybot/script/method/ManagerMethods.java
- 10) https://github.com/Arraying/Arraybot/blob/master/src/main/java/de/arraying/arraybot/script/method/StorageMethods.java
- *Everything is case sensitive
- *Guild = Discord server
- *Inherited methods will be marked by ">" at the start of the line
- *Methods which I don't fully understand will be marked by "*" at the start of the line
- *Getting a list of something returns a java array
- JS array methods will not work, but you can still access each element using indexes as usual
- You can loop through the array with for(x in arr) or for each(x in arr)
- Import from pastebin/gist github (it will act like the entire page was copy-pasted, and everything in that page will be executed)
- If nesting imports, each file only gets imported once and all repeats are ignored
- #include [insert url raw here]
- Script commands are evaluated internally inside a function, so you can stop a script mid-way via return
- =======================================================================================================================================
- guild.<method> --> Return the thing being retrieved or null if it doesn't exist
- getID() - Get the ID of the guild
- getCreationTime() - Get the time of the guild's creation
- getName() - Get the name of the guild
- getIcon() - Get the icon URL of the guild
- getOwner() - Get the owner of the guild
- getTextChannels() - Get a list of all text channels in the guild
- getTextChannel("ID") - Get the specific text channel by its "ID"
- getVoiceChannels() - Get a list of all voice channels in the guild
- getvoiceChannel("ID") - Get the specific voice channel by its "ID"
- getUsers() - Get a list of all users in the guild
- getUser("ID") - Get the specific user by its "ID"
- getRoles() - Get a list of all roles in the guild
- getRole("ID") - Get the specific role by its "ID"
- channel.<method> --> Return the thing being retrieved (unless specified otherwise)
- getID() - Get the ID of the channel
- message("string" or embed) - Send "string" as a text message or embed message into the channel --> Return undefined
- > getCreationTime() - Get the time of the channel's creation
- > createInvite() - Create an invite to the channel --> Return invite URL
- > delete() - Delete the channel --> Return undefined
- > getName() - Get the name of the channel
- >* getPosition() - Get the position of the channel (need to check if start is 0 or 1)
- > setBitrate(int) - Set the bitrate of the channel (voice channel only, 8000 ≤ int ≤ 96000) --> Return undefined
- > setName("string") - Set the name of the channel --> Return undefined
- > setNSFW(booleen) - Set the NSFW property of the channel --> Return undefined
- >* setPosition(int) - Set the position of the channel (acts weirdly depending on channel) --> Return undefined
- > setTopic("string") - Set the topic of the channel --> Return undefined
- > setUserLimit(int) - Set the user limit of the channel (voice channel only, 0 ≤ int ≤ 99) --> Return undefined
- <role>.<method> --> Return the thing being retrieved (unless specified otherwise)
- *Role has to be gotten via other methods, like guild.getRole("ID")
- getID() - Get the ID of the role
- getCreationTime() - Get the time of the role's creation
- getName() - Get the name of the role
- getColor() - Get the color of the role in RGB (defaults to null)
- getPosition() - Get the position of the role (start on 0 from bottom of role list excluding "@everyone")
- isHoisted() - Check if the role is hoisted (displayed separately in user list) --> Return true/false
- isMentionable() - Check if the role is mentionable --> Return true/false
- user.<method> --> Return the thing being retrieved (unless specified otherwise)
- getID() - Get the ID of the user
- getCreationTime() - Get the time of the user's creation
- getAvatar() - Get the avatar URL of the user
- getName() - Get the actual name of the user
- getNickname() - Get the nickname of the user (defaults to null instead of actual name)
- > message("string" or embed) - Send a DM containing "string" or embed to the user --> Return undefined
- message.<method> --> Return the thing being retrieved (unless specified otherwise)
- getID() - Get the id of the message
- getCreationTime() - Get the time of the message's creation
- getUser() - Get the user that sent the message
- getChannel() - Get the channel in which the message was sent
- getContent() - Get the full content of the message
- getEditTime() - Get the time of (first? last?) edit made on the message
- getEmbeds() - Get the embeds of the message
- pin() - Toggle the pinned status of the message --> Return true/false (true = message got pinned)
- delete() - Delete the message --> Return undefined
- embeds.<method> --> Return as specified
- *Refer to link7a for full list
- *Some of my experiments with embeds if they're of any help: https://pastebin.com/8nHaw9ej
- newEmbed() - Create a new embed builder --> Return embed builder
- canSend(embed or msg embed) - Check if the embed can be sent --> Return true/false
- -->embedbuilder.<method>
- commands.<method> --> Return undefined
- executeCommand("name",arg) - Execute the "name" command with optional [argument] (argument is a string array)
- *Name of command as listed in source link 8a
- *Dev-only commands: eval, reload, script, shards (and you can't cheat by calling on them via custom scripts)
- manager.<method> --> Return true if successfully executed. False otherwise
- addRole(user,role) - Add role to user
- removeRole(user,role) - Remove role from user
- kick(user) - Kick user from the guild
- ban(user) - Ban user from the guild
- nickname(user,"name") - Change user nickname to "name"
- storage.<method> --> Return as specified
- *Storages are like persistent variables that store string only. Non premium(?) guild can store up to 5000
- get("key") - Get the specific stored value via "key" (defaults to "null" as a string)
- set("key",value) - Set a stored value as string with "key" --> Return value
- delete("key") - Delete the specific stored value via "key" --> Return undefined
- getKeys() - Get the list of keys used in the guild
- time --> Return current time in ISO 8601 format in UTC
- [YYYY]-[MM]-[DD]T[HH]:[MM]:[SS].[mmm]Z
- T separates date from time, Z represent UTC timezone
- If you just need to compute time difference, javascript's Date.now() might be better
- =======================================================================================================================================
- Examples
- General storage key management and tracking: https://gist.github.com/Eta740/e8b4052440abb7f789302169b363dba3
- Evaluate JS code: https://gist.github.com/Eta740/8bbfd76e8e4883e4d6eb8cb18c65e629
- Google Search: https://gist.github.com/Eta740/e18030a612c7ad2346bf1619d2af68af
- Color text with syntax highlighting: https://gist.github.com/Eta740/712b6442a9cddd9d030deb78e550144b
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement