Finished channels

This commit is contained in:
hydrabolt
2015-11-20 20:44:09 +00:00
parent d26702f48f
commit 19fb8e6dfd
10 changed files with 127 additions and 14 deletions

28
docs/docs_pmchannel.rst Normal file
View File

@@ -0,0 +1,28 @@
.. include:: ./vars.rst
PMChannel
=========
**extends** Channel_
A PMChannel is a Private/Direct channel between the Client and another user.
------
Attributes
----------
messages
~~~~~~~~
A Cache_ of Message_ objects.
recipient
~~~~~~~~~
The User_ that is the recipient of the Channel.
lastMessage
~~~~~~~~~~~
The last Message_ sent in the channel, may be null if no messages have been sent during the time the bound Client_ has been online.

View File

@@ -0,0 +1,49 @@
.. include:: ./vars.rst
ServerChannel
=============
A ServerChannel is a Channel_ that belongs to a Server_.
Attributes
----------
name
~~~~
`String`, name of the channel.
type
~~~~
`String`, either ``voice`` or ``text``.
position
~~~~~~~~
`Number`, position in the channel list.
permissionOverwrites
~~~~~~~~~~~~~~~~~~~~
Cache_ of all the PermissionOverwrite_ objects affecting the channel.
server
~~~~~~
Server_ the channel belongs to.
Functions
---------
permissionsOf(user)
~~~~~~~~~~~~~~~~~~~
**Aliases:** permsOf
Returns a ChannelPermissions_ object of a user's permissions in that channel.
mention()
~~~~~~~~~
Returns a `string` that can be used in discord messages to mention a channel. ``serverChannel.toString()` defaults to this.

28
docs/docs_textchannel.rst Normal file
View File

@@ -0,0 +1,28 @@
.. include:: ./vars.rst
TextChannel
===========
**extends** ServerChannel_
A text channel of a server.
------
Attributes
----------
topic
~~~~~
The topic of the channel, a `String`.
lastMessage
~~~~~~~~~~~
Last Message_ sent in the channel. May be null if no messages sent whilst the Client was online.
messages
~~~~~~~~
A Cache_ of Message_ objects.

View File

@@ -0,0 +1,10 @@
.. include:: ./vars.rst
VoiceChannel
============
**extends** ServerChannel_
A voice channel of a server. Currently, the voice channel class has no differences to the ServerChannel class.
------

View File

@@ -24,6 +24,10 @@ Contents:
:caption: Channel Documentation
docs_channel
docs_pmchannel
docs_serverchannel
docs_textchannel
docs_voicechannel
.. toctree::
:maxdepth: 2

View File

@@ -3,5 +3,7 @@
.. _User : ./docs_user.html
.. _Server : ./docs_server.html
.. _Channel : ./docs_channel.html
.. _ServerChannel : ./docs_serverchannel.html
.. _TextChannel : ./docs_textchannel.html
.. _Promises : https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise
.. _EventEmitter : https://nodejs.org/api/events.html#events_class_events_eventemitter