/* Native, implemented in Java
 * This class is used to interact with Discord users.
 * Import with 'import DiscordUser from '
 */
class DiscordUser {
    /*
     * This gets the name of the user
     * Returns - String: The name of the user
     */
    fun getName();

    /*
     * This gets the id of the user
     * Returns - String: The id of the user
     */
    fun getId();

    /*
     * This gets the tag of the user, the numbers after the #
     * Returns - String: The tag of the user
     */
    fun getTag();

    /*
     * This gets the name and tag of the user
     * Returns - String: The name and tag of the user
     */
    fun getNameAndTag();
}

/* Native, implemented in Java
 * This class allows you to get and send messages in the channel
 * Import with 'import DiscordChannel from '
 */
class DiscordChannel {
    /*
     * This sends a file to this channel
     * Parameter - File (file): the file you want to send
     * Returns - DiscordMessage: the message that was sent
     */
    fun sendFile(file);

    /*
     * This gets a message by its id
     * Parameter - String (messageId): the id of the message
     * Returns - DiscordMessage: the message
     * Throws - Error: Message with id ... couldn't be found
     */
    fun getMessageFromId(messageId);

    /*
     * This gets the last X messages
     * Parameter - Number (amount): the amount of messages to get
     * Returns - List: the messages
     */
    fun getHistory(amount);

    /*
     * This sends an embed to this channel.
     * In the embed map, you can use the following keys:
     * 'title' as String, ''description' as String or List of String, 'colour'/'color' as Number
     * 'fields' as Map with keys: ('name' as String, 'value' as String, 'inline' as Boolean)
     * and 'image' as String that is an url
     * Parameter - Map (embedMap): the embed map
     * Returns - DiscordMessage: the message that was sent
     */
    fun sendEmbed(embedMap);

    /*
     * This sends a message to this channel
     * Parameter - String (message): the message
     * Returns - DiscordMessage: the message that was sent
     */
    fun sendMessage(message);

    /*
     * This marks the bot as typing in this channel, it lasts 10 seconds or until the message is sent
     */
    fun markTyping();
}

/* Native, implemented in Java
 * This class lets you create a Discord bot and interact with it.
 * Import with 'import DiscordBot from '
 */
class DiscordBot {
    /*
     * This creates a new DiscordBot instance
     * Parameter - String (token): The token of the bot
     */
    DiscordBot(token);

    /*
     * This gets a server by its id
     * Parameter - String (serverId): the id of the server
     * Returns - DiscordServer: the server
     * Throws - Error: Server with id ... couldn't be found
     */
    fun getServer(serverId);

    /*
     * This removes a slash command from the bot
     * Parameter - String (commandName): the name of the command
     */
    fun removeCommand(commandName);

    /*
     * This gets the activity of the bot
     * Returns - String: The activity of the bot, null if no activity
     */
    fun getActivity();

    /*
     * This stops the bot
     */
    fun stop();

    /*
     * This gets a channel by its id
     * Parameter - String (channelId): the id of the channel
     * Returns - DiscordChannel: the channel
     * Throws - Error: Channel with id ... couldn't be found
     */
    fun getChannel(channelId);

    /*
     * This adds a slash command to the bot
     * Each command must have a name and description, it can have a command, define the next subcommand with 'next'
     * and subcommands must have the argument type, and can have whether it is required or not
     * types: 'string', 'integer', 'number', 'boolean', 'user', 'channel', and 'attachment'
     * Parameter - Map (commandMap): the command map
     * Throws - Error: Command must have name and a description, Slash command went too deep, Command must include option type, Invalid option
     */
    fun addCommand(commandMap);

    /*
     * This gets the status of the bot
     * Returns - String: The status of the bot
     */
    fun getStatus();

    /*
     * This registers a function to be called when an event is triggered
     * Parameter - String (eventName): the name of the event
     * Parameter - Function (function): the function to be called
     */
    fun registerEvent(eventName, function);

    /*
     * This gets the user id of the bot
     * Returns - String: The user id of the bot
     */
    fun getUserId();

    /*
     * This sets the status of the bot
     * Parameter - String (status): The status you want the bot to have
     * Throws - Error: ... is an invalid status
     */
    fun setStatus(status);

    /*
     * This sets the activity of the bot
     * Parameter - String (activity): The activity you want the bot to have
     * Parameter - String (message): The message you want to display
     * Throws - Error: ... is an invalid activity
     */
    fun setActivity(activity, message);
}

/* Native, implemented in Java
 * This class allows you to interact with Discord servers.
 * Import with 'import DiscordServer from '
 */
class DiscordServer {
    /*
     * This unbans a user from the server
     * Parameter - DiscordUser (user): the user to unban
     */
    fun unban(user);

    /*
     * This kicks a user from the server
     * Parameter - DiscordUser (user): the user to kick
     * Throws - Error: Member was null
     */
    fun kick(user);

    /*
     * This gets the amount of members in the server
     * Returns - Number: the amount of members
     */
    fun getMemberCount();

    /*
     * This gets the id of the owner of the server
     * Returns - String: the id of the owner
     */
    fun getOwnerId();

    /*
     * This creates a role in the server
     * In the role map you can have the following keys:
     * 'name' as String, 'colour'/'color' as Number, 'hoisted' as Boolean, 'mentionable as Boolean'
     * and 'permissions' as a List of Strings, for example ['Manage Channels', 'Manage Server'], see Discord for more
     * Parameter - Map (roleMap): the map of the role
     */
    fun createRole(roleMap);

    /*
     * This gets a user from the server by their id
     * Parameter - String (userId): the id of the user
     * Returns - DiscordUser: the user, if the user cannot be found returns null
     */
    fun getUserFromId(userId);

    /*
     * This bans a user from the server
     * Parameter - DiscordUser (user): the user to ban
     */
    fun ban(user);

    /*
     * This bans a user from the server, with a reason
     * Parameter - DiscordUser (user): the user to ban
     * Parameter - String (reason): the reason for the ban
     */
    fun ban(user, reason);
}

/* Native, implemented in Java
 * This class allows you to interact with Discord messages.
 * Import with 'import DiscordMessage from '
 */
class DiscordMessage {
    /*
     * This gets the server the message was sent in
     * Returns - DiscordServer: The server the message was sent in
     */
    fun getServer();

    /*
     * This checks if the message is pinned
     * Returns - Boolean: true if the message is pinned, false if not
     */
    fun isPinned();

    /*
     * This gets the author of the message
     * Returns - DiscordUser: The author of the message
     */
    fun getAuthor();

    /*
     * This checks if the message is edited
     * Returns - Boolean: true if the message is edited, false if not
     */
    fun isEdited();

    /*
     * This gets the id of the message
     * Returns - String: The id of the message
     */
    fun getId();

    /*
     * This deletes the message
     */
    fun delete();

    /*
     * This replies to the message with the given embed map
     * In the embed map, you can use the following keys:
     * 'title' as String, ''description' as String or List of String, 'colour'/'color' as Number
     * 'fields' as Map with keys: ('name' as String, 'value' as String, 'inline' as Boolean)
     * and 'image' as String that is an url
     * Parameter - Map (embedMap): the embed map
     * Returns - DiscordMessage: the message that was sent
     */
    fun replyWithEmbed(embedMap);

    /*
     * This gets the attachments of the message
     * Returns - List: List with the attachments of the message
     */
    fun getAttachments();

    /*
     * This adds a reaction to the message with a specific emoji id
     * Parameter - String (emojiId): the emoji id
     * Throws - Error: ... is not a valid emote id
     */
    fun addReaction(emojiId);

    /*
     * This adds a reaction to the message with a specific unicode
     * Parameter - String (unicode): the unicode character
     */
    fun addReactionUnicode(unicode);

    /*
     * This pins the message if true, and removes if false
     * Parameter - Boolean (bool): true to pin, false to unpin
     */
    fun pin(bool);

    /*
     * This gets the channel the message was sent in
     * Returns - DiscordChannel: The channel the message was sent in
     */
    fun getChannel();

    /*
     * This removes all reactions from the message
     */
    fun removeAllReactions();

    /*
     * This gets the raw message content
     * Returns - String: The raw message content
     */
    fun getRaw();

    /*
     * This gets the raw message content
     * Returns - String: The raw message content
     */
    fun toString();

    /*
     * This replies to the message with the given message
     * Parameter - String (message): the message
     * Returns - DiscordMessage: the message that was sent
     */
    fun reply(message);

    /*
     * This replies to the message with the given file
     * Parameter - File (file): the file
     * Returns - DiscordMessage: the message that was sent
     */
    fun replyWithFile(file);
}

/* Native, implemented in Java
 * This class lets you download and manipulate discord attachments.
 * Import with 'import DiscordAttachment from '
 */
class DiscordAttachment {
    /*
     * This allows you to get the url of the attachment
     * Returns - String: the url of the attachment
     */
    fun getUrl();

    /*
     * This allows you to check if the attachment is an image
     * Returns - Boolean: true if the attachment is an image, false otherwise
     */
    fun isImage();

    /*
     * This allows you to get the size of the attachment
     * Returns - Number: the size of the attachment in bytes
     */
    fun getSize();

    /*
     * This allows you to save an attachment to a file
     * Parameter - File (file): the file you want to save the attachment to
     */
    fun saveToFile(file);

    /*
     * This allows you to get the file extension of the attachment
     * Returns - String: the file extension of the attachment
     */
    fun getFileExtension();

    /*
     * This allows you to check if the attachment is a video
     * Returns - Boolean: true if the attachment is a video, false otherwise
     */
    fun isVideo();

    /*
     * This allows you to get the file name of the attachment
     * Returns - String: the file name of the attachment
     */
    fun getFileName();
}

/* Native, implemented in Java
 * This class is an event wrapper that you can use to access event parameters.
 * Import with 'import DiscordEvent from '
 */
class DiscordEvent {
    /*
     * This gets the server that is related to the event
     * Returns - DiscordServer: the server
     * Throws - Error: ... has no server
     */
    fun getServer();

    /*
     * This gets the channel that is related to the event
     * Returns - DiscordChannel: the channel
     * Throws - Error: ... has no channel
     */
    fun getChannel();

    /*
     * This gets the name of the event
     * Returns - String: the name of the event
     */
    fun getEventName();

    /*
     * This gets the user that is related to the event
     * Returns - DiscordUser: the user
     * Throws - Error: ... has no user
     */
    fun getUser();

    /*
     * This gets the message that is related to the event
     * Returns - DiscordMessage: the message
     * Throws - Error: ... has no message
     */
    fun getMessage();

    fun reply(arg1);

    /*
     * This replies to the event with the given file
     * Parameter - File (file): the file
     */
    fun replyWithFile(file);

    /*
     * This replies to the event with the given embed map
     * In the embed map, you can use the following keys:
     * 'title' as String, ''description' as String or List of String, 'colour'/'color' as Number
     * 'fields' as Map with keys: ('name' as String, 'value' as String, 'inline' as Boolean)
     * and 'image' as String that is an url
     * Parameter - Map (embedMap): the embed map
     */
    fun replyWithEmbed(embedMap);
}


