Nertivia.PHP

Simple API for Nertivia.net written in PHP.

Nertivia server support: https://nertivia.net/i/php

Composer installation:

composer require patryqhyper/nertivia-php-wrapper

Usage:

<?php

use PatryQHyper\Nertivia\NertiviaClient;

require_once('vendor/autoload.php');

try {
	$nertivia = new NertiviaClient('apiKey', true);
	
	# actions here
}
catch(Exception $e)
{
	echo 'Error code: '.$e->getCode().' Error info: '.$e->getMessage();
}

in NertiviaClient(), first argument is api key (hauthId), and second argument is (bool) beta (default: false)

Messages

Get last 50 messages

$nertivia->get50Messages('channelId');

Send message

$nertivia->sendMessage('channelId', 'message');

Delete message

$nertivia->deleteMessage('channelId', 'messageId');

Channels

Create channel

$nertivia->createChannel('guildId', 'channelName');

Edit channel

$nertivia->editChannel('guildId', 'channelId', 'channelName', 'permissions');

!!! permissions is an ARRAY

Delete channel

$nertivia->deleteChannel('guildId', 'channelId');

Roles

Create role

$nertivia->createRole('guildId', 'roleName');

Add role to member

$nertivia->addRoleToMember('guildId', 'roleId', 'memberId');

Delete role from member

$nertivia->deleteRoleFromMember('guildId', 'roleId', 'memberId');

Edit role

$nertivia->editRole('guildId', 'roleId', 'roleName', 'rolePermissions', 'roleColor');

Delete role

$nertivia->deleteRole('guildId', 'roleId');

Servers

Create server

$nertivia->createServer('serverName');

Get server info using server id

$nertivia->getServerInfoById('serverId');

Get server info using invite

$nertivia->getServerInfoByInvite('inviteCode');

Edit server

$nertivia->editServer('serverId', 'serverName');

Join server

$nertivia->joinServer('inviteCode');

Leave server

$nertivia->leaveServer('serverId');

Delete server

$nertivia->deleteServer('serverId');

Kick member from server

$nertivia->kickMemberFromServer('serverId', 'memberId');

Ban member from server

$nertivia->banMemberFromServer('serverId', 'memberId');

Unban member from server

$nertivia->unbanMemberFromServer('serverId', 'memberId');

Get server bans

$nertivia->getServerBans('serverId');

Users

Get user info

$nertivia->getUserInfo('userId');

Edit user survey

$nertivia->editUserSurvey('aboutMe', 'age', 'continent', 'country', 'gender', 'name');

Set custom status

$nertivia->setCustomStatus('status');

Send friend request

$nertivia->sendFriendRequest('username', 'tag');

Accept friend request

$nertivia->acceptFriendRequest('uniqueId');

Decline friend request

$nertivia->declineFriendRequest('uniqueId');

Block user

$nertivia->blockUser('uniqueId');

Unblock user

$nertivia->unblockUser('uniqueId');

Get bot list

$nertivia->getBotList();

Create bot

$nertivia->createBot();

Get bot info

$nertivia->getBotInfo('botId');

Delete bot

$nertivia->deleteBot('botId');

Create account

$nertivia->createAccount('email', 'password', 'username');

Delete account

$nertivia->deleteAccount();

Logout (may not work)

$nertivia->logout();