Skip to content

Commit

Permalink
Starting docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Naamloos committed Jan 3, 2017
1 parent 95ef219 commit e4e264b
Show file tree
Hide file tree
Showing 7 changed files with 218 additions and 24 deletions.
16 changes: 16 additions & 0 deletions docs/Programming Reference/DiscordApplication.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
DiscordApplication
===================
Represesents an API Application

## Members
`string` `Description`: Description of this API Application

`string` `Icon`: Icon hash for this API Application

`string` `Name`: Name for this API Application

`List<string>` `RpcOrigins`: Not quite sure what this is ;)

`int` `Flags`: Neither sure what this is

`DiscordApplicationOwner` `Owner`: Owner of this API Application
10 changes: 10 additions & 0 deletions docs/Programming Reference/DiscordApplicationOwner.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
DiscordApplicationOwner
========================
Represesents the owner of a DiscordApplication

## Members
`string` `Username`: Username for this App's owner

`string` `Discriminator`: Discriminator for this App's owner

`string` `Avatar`: Avatar hash for this App's owner
16 changes: 16 additions & 0 deletions docs/Programming Reference/DiscordAttachment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
DiscordAttachment
=================
Represesents a file attached to a message.

## Members
`string` `FileName`: File name for this attachment

`int` `FileSize`: Size of this file in bytes

`string` `Url`: URL for this attachment

`string` `ProxyUrl`: Proxy URL for this attachment

`int` `Height`: Height for this attachment (if image)

`int` `Width`: Width for this attachment (if image)
171 changes: 171 additions & 0 deletions docs/Programming Reference/DiscordChannel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
DiscordChannel
==============
Represents a guild channel

## Members

`ulong` `GuildID`: This channel's Guild's ID

`string` `Name`: This channel's Name

`ChannelType` `Type`: This channel's type (Text or Voice)

`int` `Position`: this channel's position

`bool` `IsPrivate`: Wether this is a private channel

`DiscordGuild` `Parent`: This channel's DiscordGuild (if public)

`List<DiscordOverwrite>` `PermissionOverwrites`: Permissions for this channel

`string` `Topic`: This channel's topic

`ulong` `LastMessageID`: ID for this channel's last message (if Text)

`int` `Bitrate`: This channel's bitrate (if Voice)

`int` `UserLimit`: This channel's user limit (if Voice)

`string` `Mention`: Builds a mention for this channel

## Methods

#### SendMessage

Sends a message to this channel

`string content`: Content for this message

`bool tts = false`: Wether this message is a TTS message

`DiscordEmbed embed = null`: Embed to attach

Returns: `DiscordMessage`

#### SendFile

Sends a message to this channel with a file attached

`string filepath`: Path to the file you want to send

`string filename`: Name for this file (with extension)

`string content = ""`: Content for this message

`bool tts = false`: Wether this is a TTS message

Returns: `DiscordMessage`

#### Delete

Deletes this channel (No arguments)

Returns: Nothing

#### GetMessage

Gets a message from this channel

`ulong ID` ID for this message

Returns: `DiscordMessage`

#### ModifyPosition

Modifies this channel's position

`int position`: New position for this channel

Returns: Nothing

#### GetMessages

Gets a list of DiscordMessages (Only set one out of around, before and after!)

`ulong around = 0`: Gets messages around this ID

`ulong before = 0`: Gets messages before this ID

`ulong after = 0`: Gets messages after this ID

`int limit = 50`: Limits the amount of messages

Returns: `List<DiscordMessage>`

#### BulkDeleteMessages

Deletes multiple DiscordMessages

`List<ulong> MessageIDs`: List of messages to delete

Returns: Nothing

#### GetInvites

Gets this channel's DiscordInvites

Returns: `List<DiscordInvite>`

#### CreateInvite

Creates an invite for this channel

`int MaxAge = 86400`: Max age for this invite

`int MaxUses = 0`: Max uses for this invite (0 = unlimited)

`bool temporary = false`: Wether this invite is temporary or not

`bool unique = false`: Wether this invite has to be a new one or a pre-existing one may be returned

Returns: `DiscordInvite`

#### DeleteChannelPermission

Deletes a channel's permission

`ulong OverwriteID`: ID for this permission

Returns: Nothing

#### TriggerTyping

Makes you appear typing

Returns: Nothing

#### GetPinnedMessages

Gets pinned messages for this channel

Returns: `List<DiscordMessage>`

#### CreateWebhook

Creates a webhook for this channel

`string Name = ""`: Name for this webhook

`string base64avatar = ""`: Avatar for this webhook in base64

Returns: `DiscordWebhook`

#### GetWebhooks

Gets this channel's webhooks

Returns: `List<DiscordWebhook>`

#### ConnectToVoice

Connects to this voice channel

Returns: Nothing

#### PlaceMember

Places a member in this voice channel (if member is connected to voice)

`ulong MemberID`: Member's ID

Returns: Nothing
25 changes: 3 additions & 22 deletions docs/index.md → docs/Tutorials/I._Your_Initial_Code.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,5 @@
![Logo](https://github.com/NaamloosDT/DSharpPlus/blob/master/logo/dsharp+_smaller.png?raw=true)

A C# API for Discord based off [DiscordSharp](https://github.com/suicvne/DiscordSharp), but rewritten to fit the API standards.

## Installation
### Nuget
1. Create a new Console Application
2. In the Projects tab, click "Manage NuGet Packages"
3. Click Browse
4. Search for "DSharpPlus" and install the latest version
5. Done!

### Compiling by yourself
1. Download the Git repository
2. Open the project in Visual Studio
3. Build
4. Create a new Console Application
5. Refrence the built DLLs
6. Done!

## Your initial code
Your initial code
==================
There are 2 ways you can do this, first is the basic way:
```cs
using System;
Expand Down Expand Up @@ -75,4 +56,4 @@ namespace DSharpPlusBot
}
```
## Where to from here
From here you can go to the next chapter, "Your First Message". Use the code from above and continue on.
From here you can go to the next chapter, "Your First Message". Use the code from above and continue on.
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ Inside that if statement, we will ahve the bot send a message. This line of code
Now, compile and run the bot. In a channel that both you and the bot can post in, type "!hello" and you should receive a message back.

## Where to from here
Proceed to "Commands Module" page.
Proceed to "Commands Module" page.
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,4 @@ void CreateCommands(DiscordClient _client)
});
}
```
Now, compile and run your bot. Try out the new command by putting in "!hello" into chat. You should receive a message back similar to "Hello, @username".
Now, compile and run your bot. Try out the new command by putting in "!hello" into chat. You should receive a message back similar to "Hello, @username".

0 comments on commit e4e264b

Please sign in to comment.