C# Class DiscordSharp.DiscordClient

Show file Open project: Luigifan/DiscordSharp Class Usage Examples

Public Properties

Property Type Description
GetLastVoiceClientLogger Logger

Private Properties

Property Type Description
BeginHeartbeatTask void
ChangeClientUsername void
ChannelCreateEvents void
ChannelDeleteEvents void
ChannelUpdateEvents void
ClientPacketReceived void
ConnectToVoiceAsync Task
ConnectToVoiceAsync void
FindInMessageLog DiscordSharp.DiscordMessage
GetChannelsList void
GetDiscordChannelByID DiscordSharp.DiscordChannel
GetGatewayUrl string
GuildCreateEvents void
GuildDeleteEvents void
GuildMemberAddEvents void
GuildMemberBanRemovedEvents void
GuildMemberBannedEvents void
GuildMemberChunkEvents void
GuildMemberRemoveEvents void
GuildMemberUpdateEvents void
GuildRoleDeleteEvents void
GuildRoleUpdateEvents void
GuildUpdateEvents void
KeepAlive void
MessageCreateEvents void
MessageDeletedEvents void
MessageUpdateEvents void
MiscellaneousOpcodes void
PerformReconnection void
PresenceUpdateEvents void
SendActualMessage DiscordSharp.DiscordMessage
SendDeleteRequest void
SendIdentifyPacket void
ServerInfo Newtonsoft.Json.Linq.JObject
UserUpdateEvents void
VoiceServerUpdateEvents void
VoiceStateUpdateEvents void

Public Methods

Method Description
AcceptInvite ( string inviteID ) : void

(Client account only) accepts an invite to a server.

AssignRoleToMember ( DiscordSharp.DiscordServer guild, DiscordSharp.DiscordRole role, DiscordSharp.DiscordMember member ) : void

Assigns a specified role to a member, given you have the permission.

AssignRoleToMember ( DiscordSharp.DiscordServer guild, List roles, DiscordSharp.DiscordMember member ) : void

Assigns the specified roles to a member, given you have the permission.

AttachFile ( DiscordSharp.DiscordChannel channel, string message, System stream ) : void

Sends a file to the specified DiscordChannel with the given message.

AttachFile ( DiscordSharp.DiscordChannel channel, string message, string pathToFile ) : void

Sends a file to the specified DiscordChannel with the given message.

BanMember ( DiscordSharp.DiscordMember member, DiscordSharp.DiscordServer serverOverride, int days ) : DiscordSharp.DiscordMember

Bans a specified DiscordMember from the guild that's assumed from their parent property.

BanMember ( DiscordSharp.DiscordMember member, int days ) : DiscordSharp.DiscordMember

Bans a specified DiscordMember from the guild that's assumed from their parent property.

ChangeChannelTopic ( string Channeltopic, DiscordSharp.DiscordChannel channel ) : void

Changes the channel topic assosciated with the Discord text channel.

ChangeClientAvatar ( Bitmap image ) : void

Changes the current client's avatar. Any high resolution pictures are automatically downscaled and Discord will perform jpeg compression on them.

ChangeClientInformation ( DiscordSharp.DiscordUserInformation info ) : void

Used for changing the client's email, password, username, etc.

ChangeGuildIcon ( Bitmap image, DiscordSharp.DiscordServer guild ) : void

Changes the icon assosciated with the guild. Discord will perform jpeg compression and this image is automatically downscaled.

ClearInternalMessageLog ( ) : int

Clears the internal message log cache

ClearOfflineUsersFromServer ( DiscordSharp.DiscordServer server ) : int

Iterates through a server's members and removes offline users.

Connect ( bool useDotNetWebsocket = false ) : void

Runs the websocket connection for the client hooking up the appropriate events.

ConnectToVoiceChannel ( DiscordSharp.DiscordChannel channel, DiscordSharp.DiscordVoiceConfig voiceConfig = null, bool clientMuted = false, bool clientDeaf = false ) : void

Connects to a given voice channel.

ConnectedToVoice ( ) : bool

CreateChannel ( DiscordSharp.DiscordServer server, string ChannelName, bool voice ) : DiscordSharp.DiscordChannel

Creates either a text or voice channel in a DiscordServer given a name. Given you have the permission of course.

CreateGuild ( string GuildName ) : DiscordSharp.DiscordServer

Creates an empty guild with only this client in it given the following name. Unknown if works on bot accounts or not.

CreateInvite ( DiscordSharp.DiscordChannel channel ) : string

Creates and invite to the given channel.

CreateRole ( DiscordSharp.DiscordServer guild ) : DiscordSharp.DiscordRole

Creates a default role in the specified guild.

DeleteAllMessages ( ) : int

Deletes all messages made by the bot since running.

DeleteChannel ( DiscordSharp.DiscordChannel channel ) : void

Deletes a specified Discord channel given you have the permission.

DeleteInvite ( string id ) : void

Deletes an invite by id

DeleteMessage ( DiscordSharp.DiscordMessage message ) : void

Deletes a specified DiscordMessage.

DeleteMessage ( string id ) : void

Deletes a message with a specified ID. This method will only work if the message was sent since the bot has ran.

DeleteMultipleMessagesInChannel ( DiscordSharp.DiscordChannel channel, int count ) : int

Deletes the specified number of messages in a given channel. Thank you to Siegen for this idea/method!

DeleteRole ( DiscordSharp.DiscordServer guild, DiscordSharp.DiscordRole role ) : void

Deletes a specified role.

DeleteServer ( DiscordSharp.DiscordServer server ) : void

(Owner only, non-bot only) Sends an http DELETE request to delete the server you specify.

DeleteServer ( string ServerID ) : void

(Owner only, non-bot only) Sends an http DELETE request to delete the server you specify by ID.

DisconnectFromVoice ( ) : void

Also disposes

DiscordClient ( string tokenOverride = null, bool isBotAccount = false, bool enableLogging = true ) : System

Dispose ( ) : void

Disposes.

EchoPacket ( DiscordSharp.DiscordAudioPacket packet ) : void

Echoes a received audio packet back.

EditGuildName ( DiscordSharp.DiscordServer guild, string NewGuildName ) : void

Edits the name of the guild, given you have the permission.

EditMessage ( string MessageID, string replacementMessage, DiscordSharp.DiscordChannel channel ) : DiscordSharp.DiscordMessage

If you screwed up, you can use this method to edit a given message. This sends out an http patch request with a replacement message

EditRole ( DiscordSharp.DiscordServer guild, DiscordSharp.DiscordRole newRole ) : DiscordSharp.DiscordRole

Edits a role with the new role information.

GetBans ( DiscordSharp.DiscordServer server ) : List

Retrieves a DiscordMember List of members banned in the specified server.

GetChannelByID ( long id ) : DiscordSharp.DiscordChannel

GetChannelByName ( string channelName ) : DiscordSharp.DiscordChannel

you probably shouldn't use this.

GetLastMessageSent ( ) : DiscordSharp.DiscordMessage

GetLastMessageSent ( DiscordSharp.DiscordChannel inChannel ) : DiscordSharp.DiscordMessage

GetMemberFromChannel ( DiscordChannelBase channel, string id ) : DiscordSharp.DiscordMember

GetMemberFromChannel ( DiscordChannelBase channel, string username, bool caseSensitive ) : DiscordSharp.DiscordMember

GetMessageHistory ( DiscordChannelBase channel, int count, string idBefore = "", string idAfter = "" ) : List

Returns a List of DiscordMessages.

GetMessageLog ( ) : DiscordMessage>.Dictionary

Any messages logged since connection to the websocket.

GetPrivateChannels ( ) : List

Private channels assosciated with the account.

GetServerChannelIsIn ( DiscordSharp.DiscordChannel channel ) : DiscordSharp.DiscordServer

GetServersList ( ) : List

Current DiscordServers you're connected to.

GetVoiceClient ( ) : DiscordSharp.DiscordVoiceClient

KickMember ( DiscordSharp.DiscordMember member ) : void

Kicks a specified DiscordMember from the guild that's assumed from their parent property.

LeaveServer ( DiscordSharp.DiscordServer server ) : void

Sends an http DELETE request to leave the server you send in this parameter.

LeaveServer ( string ServerID ) : void

(Owner only, non-bot only) Sends an http DELETE request to delete the server you specify.

Logout ( ) : void

Logs out of Discord and then disposes.

MakeInviteURLFromCode ( string id ) : string

Just prepends https://discord.gg/ to a given invite :)

RemoveBan ( DiscordSharp.DiscordServer guild, DiscordSharp.DiscordMember member ) : void

Removes a ban on the user.

RemoveBan ( DiscordSharp.DiscordServer guild, string userID ) : void

Removes a ban on the user.

SendLoginRequest ( ) : string

Sends a login request.

SendMessageToChannel ( string message, DiscordSharp.DiscordChannel channel ) : DiscordSharp.DiscordMessage

Sends a message to a channel, what else did you expect?

SendMessageToUser ( string message, DiscordSharp.DiscordMember member ) : DiscordSharp.DiscordMessage

Sends a private message to the given user.

UpdateBotStatus ( bool idle ) : void

Updates the bot's status.

UpdateCurrentGame ( string gameName, bool streaming, string url = null ) : void

Updates the bot's 'Currently playing' status to the following text. Pass in null if you want to remove this.

Private Methods

Method Description
BeginHeartbeatTask ( ) : void
ChangeClientUsername ( string newUsername ) : void
ChannelCreateEvents ( Newtonsoft.Json.Linq.JObject message ) : void
ChannelDeleteEvents ( Newtonsoft.Json.Linq.JObject message ) : void
ChannelUpdateEvents ( Newtonsoft.Json.Linq.JObject message ) : void
ClientPacketReceived ( Newtonsoft.Json.Linq.JObject message ) : void
ConnectToVoiceAsync ( ) : Task
ConnectToVoiceAsync ( ) : void
FindInMessageLog ( System.String id ) : DiscordSharp.DiscordMessage
GetChannelsList ( Newtonsoft.Json.Linq.JObject m ) : void
GetDiscordChannelByID ( string id ) : DiscordSharp.DiscordChannel
GetGatewayUrl ( ) : string
GuildCreateEvents ( Newtonsoft.Json.Linq.JObject message ) : void
GuildDeleteEvents ( Newtonsoft.Json.Linq.JObject message ) : void
GuildMemberAddEvents ( Newtonsoft.Json.Linq.JObject message ) : void
GuildMemberBanRemovedEvents ( Newtonsoft.Json.Linq.JObject message ) : void
GuildMemberBannedEvents ( Newtonsoft.Json.Linq.JObject message ) : void
GuildMemberChunkEvents ( Newtonsoft.Json.Linq.JObject message ) : void
GuildMemberRemoveEvents ( Newtonsoft.Json.Linq.JObject message ) : void
GuildMemberUpdateEvents ( Newtonsoft.Json.Linq.JObject message ) : void
GuildRoleDeleteEvents ( Newtonsoft.Json.Linq.JObject message ) : void
GuildRoleUpdateEvents ( Newtonsoft.Json.Linq.JObject message ) : void
GuildUpdateEvents ( Newtonsoft.Json.Linq.JObject message ) : void
KeepAlive ( ) : void
MessageCreateEvents ( Newtonsoft.Json.Linq.JObject message ) : void
MessageDeletedEvents ( Newtonsoft.Json.Linq.JObject message ) : void
MessageUpdateEvents ( Newtonsoft.Json.Linq.JObject message ) : void
MiscellaneousOpcodes ( Newtonsoft.Json.Linq.JObject message ) : void
PerformReconnection ( ) : void
PresenceUpdateEvents ( Newtonsoft.Json.Linq.JObject message ) : void
SendActualMessage ( string id, string message, DiscordSharp.DiscordMember recipient ) : DiscordSharp.DiscordMessage
SendDeleteRequest ( DiscordSharp.DiscordMessage message ) : void
SendIdentifyPacket ( ) : void
ServerInfo ( string channelOrServerId ) : Newtonsoft.Json.Linq.JObject
UserUpdateEvents ( Newtonsoft.Json.Linq.JObject message ) : void
VoiceServerUpdateEvents ( Newtonsoft.Json.Linq.JObject message ) : void
VoiceStateUpdateEvents ( Newtonsoft.Json.Linq.JObject message ) : void

Method Details

AcceptInvite() public method

(Client account only) accepts an invite to a server.
public AcceptInvite ( string inviteID ) : void
inviteID string The ID of the invite you want to accept. This is NOT the full URL of the invite
return void

AssignRoleToMember() public method

Assigns a specified role to a member, given you have the permission.
public AssignRoleToMember ( DiscordSharp.DiscordServer guild, DiscordSharp.DiscordRole role, DiscordSharp.DiscordMember member ) : void
guild DiscordSharp.DiscordServer The guild you and the user are in.
role DiscordSharp.DiscordRole The role you wish to assign them.
member DiscordSharp.DiscordMember The member you wish to assign the role to.
return void

AssignRoleToMember() public method

Assigns the specified roles to a member, given you have the permission.
public AssignRoleToMember ( DiscordSharp.DiscordServer guild, List roles, DiscordSharp.DiscordMember member ) : void
guild DiscordSharp.DiscordServer The guild you and the user are in.
roles List The roles you wish to assign them.
member DiscordSharp.DiscordMember The member you wish to assign the role to.
return void

AttachFile() public method

Sends a file to the specified DiscordChannel with the given message.
public AttachFile ( DiscordSharp.DiscordChannel channel, string message, System stream ) : void
channel DiscordSharp.DiscordChannel The channel to send the message to.
message string The message you want the file to have with it.
stream System A stream object to send the bytes from.
return void

AttachFile() public method

Sends a file to the specified DiscordChannel with the given message.
public AttachFile ( DiscordSharp.DiscordChannel channel, string message, string pathToFile ) : void
channel DiscordSharp.DiscordChannel The channel to send the message to.
message string The message you want the file to have with it.
pathToFile string The path to the file you wish to send (be careful!)
return void

BanMember() public method

Bans a specified DiscordMember from the guild that's assumed from their parent property.
public BanMember ( DiscordSharp.DiscordMember member, DiscordSharp.DiscordServer serverOverride, int days ) : DiscordSharp.DiscordMember
member DiscordSharp.DiscordMember
serverOverride DiscordSharp.DiscordServer
days int
return DiscordSharp.DiscordMember

BanMember() public method

Bans a specified DiscordMember from the guild that's assumed from their parent property.
public BanMember ( DiscordSharp.DiscordMember member, int days ) : DiscordSharp.DiscordMember
member DiscordSharp.DiscordMember
days int The number of days the user should be banned for, or 0 for infinite.
return DiscordSharp.DiscordMember

ChangeChannelTopic() public method

Changes the channel topic assosciated with the Discord text channel.
public ChangeChannelTopic ( string Channeltopic, DiscordSharp.DiscordChannel channel ) : void
Channeltopic string The new channel topic.
channel DiscordSharp.DiscordChannel The channel you wish to change the topic for.
return void

ChangeClientAvatar() public method

Changes the current client's avatar. Any high resolution pictures are automatically downscaled and Discord will perform jpeg compression on them.
public ChangeClientAvatar ( Bitmap image ) : void
image System.Drawing.Bitmap The Bitmap object assosciated with the avatar you wish to upload.
return void

ChangeClientInformation() public method

Used for changing the client's email, password, username, etc.
public ChangeClientInformation ( DiscordSharp.DiscordUserInformation info ) : void
info DiscordSharp.DiscordUserInformation
return void

ChangeGuildIcon() public method

Changes the icon assosciated with the guild. Discord will perform jpeg compression and this image is automatically downscaled.
public ChangeGuildIcon ( Bitmap image, DiscordSharp.DiscordServer guild ) : void
image System.Drawing.Bitmap The bitmap object associated
guild DiscordSharp.DiscordServer The guild of the icon you wish to change.
return void

ClearInternalMessageLog() public method

Clears the internal message log cache
public ClearInternalMessageLog ( ) : int
return int

ClearOfflineUsersFromServer() public method

Iterates through a server's members and removes offline users.
public ClearOfflineUsersFromServer ( DiscordSharp.DiscordServer server ) : int
server DiscordSharp.DiscordServer
return int

Connect() public method

Runs the websocket connection for the client hooking up the appropriate events.
public Connect ( bool useDotNetWebsocket = false ) : void
useDotNetWebsocket bool If true, DiscordSharp will connect using the .Net Framework's built-in WebSocketClasses. /// Please do not use this on Mono or versions of Windows below 8/8.1
return void

ConnectToVoiceChannel() public method

Connects to a given voice channel.
public ConnectToVoiceChannel ( DiscordSharp.DiscordChannel channel, DiscordSharp.DiscordVoiceConfig voiceConfig = null, bool clientMuted = false, bool clientDeaf = false ) : void
channel DiscordSharp.DiscordChannel The channel to connect to.
voiceConfig DiscordSharp.DiscordVoiceConfig The voice configuration to use. If null, default values will be used.
clientMuted bool Whether or not the client will connect muted. Defaults to false.
clientDeaf bool Whether or not the client will connect deaf. Defaults to false.
return void

ConnectedToVoice() public method

public ConnectedToVoice ( ) : bool
return bool

CreateChannel() public method

Creates either a text or voice channel in a DiscordServer given a name. Given you have the permission of course.
public CreateChannel ( DiscordSharp.DiscordServer server, string ChannelName, bool voice ) : DiscordSharp.DiscordChannel
server DiscordSharp.DiscordServer The server to create the channel in.
ChannelName string The name of the channel (will automatically be lowercased if text)
voice bool True if you want the channel to be a voice channel.
return DiscordSharp.DiscordChannel

CreateGuild() public method

Creates an empty guild with only this client in it given the following name. Unknown if works on bot accounts or not.
public CreateGuild ( string GuildName ) : DiscordSharp.DiscordServer
GuildName string The name of the guild you wish to create.
return DiscordSharp.DiscordServer

CreateInvite() public method

Creates and invite to the given channel.
public CreateInvite ( DiscordSharp.DiscordChannel channel ) : string
channel DiscordSharp.DiscordChannel
return string

CreateRole() public method

Creates a default role in the specified guild.
public CreateRole ( DiscordSharp.DiscordServer guild ) : DiscordSharp.DiscordRole
guild DiscordSharp.DiscordServer The guild to make the role in.
return DiscordSharp.DiscordRole

DeleteAllMessages() public method

Deletes all messages made by the bot since running.
public DeleteAllMessages ( ) : int
return int

DeleteChannel() public method

Deletes a specified Discord channel given you have the permission.
public DeleteChannel ( DiscordSharp.DiscordChannel channel ) : void
channel DiscordSharp.DiscordChannel The DiscordChannel object to delete
return void

DeleteInvite() public method

Deletes an invite by id
public DeleteInvite ( string id ) : void
id string The ID of the invite you wish to delete.
return void

DeleteMessage() public method

Deletes a specified DiscordMessage.
public DeleteMessage ( DiscordSharp.DiscordMessage message ) : void
message DiscordSharp.DiscordMessage
return void

DeleteMessage() public method

Deletes a message with a specified ID. This method will only work if the message was sent since the bot has ran.
public DeleteMessage ( string id ) : void
id string
return void

DeleteMultipleMessagesInChannel() public method

Deletes the specified number of messages in a given channel. Thank you to Siegen for this idea/method!
public DeleteMultipleMessagesInChannel ( DiscordSharp.DiscordChannel channel, int count ) : int
channel DiscordSharp.DiscordChannel The channel to delete messages in.
count int The amount of messages to delete (max 100)
return int

DeleteRole() public method

Deletes a specified role.
public DeleteRole ( DiscordSharp.DiscordServer guild, DiscordSharp.DiscordRole role ) : void
guild DiscordSharp.DiscordServer The guild the role is in.
role DiscordSharp.DiscordRole The role to delete.
return void

DeleteServer() public method

(Owner only, non-bot only) Sends an http DELETE request to delete the server you specify.
public DeleteServer ( DiscordSharp.DiscordServer server ) : void
server DiscordSharp.DiscordServer The DiscordServer object you want to delete.
return void

DeleteServer() public method

(Owner only, non-bot only) Sends an http DELETE request to delete the server you specify by ID.
public DeleteServer ( string ServerID ) : void
ServerID string The server's ID you want to delete.
return void

DisconnectFromVoice() public method

Also disposes
public DisconnectFromVoice ( ) : void
return void

DiscordClient() public method

public DiscordClient ( string tokenOverride = null, bool isBotAccount = false, bool enableLogging = true ) : System
tokenOverride string If you have a token you wish to use, provide it here. Else, a login attempt will be made.
isBotAccount bool Set this to true if your bot is going to be a bot account
enableLogging bool
return System

Dispose() public method

Disposes.
public Dispose ( ) : void
return void

EchoPacket() public method

Echoes a received audio packet back.
public EchoPacket ( DiscordSharp.DiscordAudioPacket packet ) : void
packet DiscordSharp.DiscordAudioPacket
return void

EditGuildName() public method

Edits the name of the guild, given you have the permission.
public EditGuildName ( DiscordSharp.DiscordServer guild, string NewGuildName ) : void
guild DiscordSharp.DiscordServer The guild's name you wish to edit.
NewGuildName string The new guild name.
return void

EditMessage() public method

If you screwed up, you can use this method to edit a given message. This sends out an http patch request with a replacement message
public EditMessage ( string MessageID, string replacementMessage, DiscordSharp.DiscordChannel channel ) : DiscordSharp.DiscordMessage
MessageID string The ID of the message you want to edit.
replacementMessage string What you want the text to be edited to.
channel DiscordSharp.DiscordChannel The channel the message is in
return DiscordSharp.DiscordMessage

EditRole() public method

Edits a role with the new role information.
public EditRole ( DiscordSharp.DiscordServer guild, DiscordSharp.DiscordRole newRole ) : DiscordSharp.DiscordRole
guild DiscordSharp.DiscordServer The guild the role is in.
newRole DiscordSharp.DiscordRole the new role.
return DiscordSharp.DiscordRole

GetBans() public method

Retrieves a DiscordMember List of members banned in the specified server.
public GetBans ( DiscordSharp.DiscordServer server ) : List
server DiscordSharp.DiscordServer
return List

GetChannelByID() public method

public GetChannelByID ( long id ) : DiscordSharp.DiscordChannel
id long
return DiscordSharp.DiscordChannel

GetChannelByName() public method

you probably shouldn't use this.
public GetChannelByName ( string channelName ) : DiscordSharp.DiscordChannel
channelName string
return DiscordSharp.DiscordChannel

GetLastMessageSent() public method

public GetLastMessageSent ( ) : DiscordSharp.DiscordMessage
return DiscordSharp.DiscordMessage

GetLastMessageSent() public method

public GetLastMessageSent ( DiscordSharp.DiscordChannel inChannel ) : DiscordSharp.DiscordMessage
inChannel DiscordSharp.DiscordChannel
return DiscordSharp.DiscordMessage

GetMemberFromChannel() public method

public GetMemberFromChannel ( DiscordChannelBase channel, string id ) : DiscordSharp.DiscordMember
channel DiscordChannelBase
id string
return DiscordSharp.DiscordMember

GetMemberFromChannel() public method

public GetMemberFromChannel ( DiscordChannelBase channel, string username, bool caseSensitive ) : DiscordSharp.DiscordMember
channel DiscordChannelBase
username string
caseSensitive bool
return DiscordSharp.DiscordMember

GetMessageHistory() public method

Returns a List of DiscordMessages.
public GetMessageHistory ( DiscordChannelBase channel, int count, string idBefore = "", string idAfter = "" ) : List
channel DiscordChannelBase The channel to return them from.
count int How many to return
idBefore string Messages before this message ID.
idAfter string Messages after this message ID.
return List

GetMessageLog() public method

Any messages logged since connection to the websocket.
public GetMessageLog ( ) : DiscordMessage>.Dictionary
return DiscordMessage>.Dictionary

GetPrivateChannels() public method

Private channels assosciated with the account.
public GetPrivateChannels ( ) : List
return List

GetServerChannelIsIn() public method

public GetServerChannelIsIn ( DiscordSharp.DiscordChannel channel ) : DiscordSharp.DiscordServer
channel DiscordSharp.DiscordChannel
return DiscordSharp.DiscordServer

GetServersList() public method

Current DiscordServers you're connected to.
public GetServersList ( ) : List
return List

GetVoiceClient() public method

public GetVoiceClient ( ) : DiscordSharp.DiscordVoiceClient
return DiscordSharp.DiscordVoiceClient

KickMember() public method

Kicks a specified DiscordMember from the guild that's assumed from their parent property.
public KickMember ( DiscordSharp.DiscordMember member ) : void
member DiscordSharp.DiscordMember
return void

LeaveServer() public method

Sends an http DELETE request to leave the server you send in this parameter.
public LeaveServer ( DiscordSharp.DiscordServer server ) : void
server DiscordSharp.DiscordServer The DiscordServer object you want to leave.
return void

LeaveServer() public method

(Owner only, non-bot only) Sends an http DELETE request to delete the server you specify.
public LeaveServer ( string ServerID ) : void
ServerID string The server's ID you want to delete.
return void

Logout() public method

Logs out of Discord and then disposes.
public Logout ( ) : void
return void

MakeInviteURLFromCode() public method

Just prepends https://discord.gg/ to a given invite :)
public MakeInviteURLFromCode ( string id ) : string
id string
return string

RemoveBan() public method

Removes a ban on the user.
public RemoveBan ( DiscordSharp.DiscordServer guild, DiscordSharp.DiscordMember member ) : void
guild DiscordSharp.DiscordServer The guild to lift the ban from.
member DiscordSharp.DiscordMember The DiscordMember object of the user to lift the ban from, assuming you have it.
return void

RemoveBan() public method

Removes a ban on the user.
public RemoveBan ( DiscordSharp.DiscordServer guild, string userID ) : void
guild DiscordSharp.DiscordServer The guild to lift the ban from.
userID string The ID of the user to lift the ban.
return void

SendLoginRequest() public method

Sends a login request.
public SendLoginRequest ( ) : string
return string

SendMessageToChannel() public method

Sends a message to a channel, what else did you expect?
public SendMessageToChannel ( string message, DiscordSharp.DiscordChannel channel ) : DiscordSharp.DiscordMessage
message string The text to send
channel DiscordSharp.DiscordChannel DiscordChannel object to send the message to.
return DiscordSharp.DiscordMessage

SendMessageToUser() public method

Sends a private message to the given user.
public SendMessageToUser ( string message, DiscordSharp.DiscordMember member ) : DiscordSharp.DiscordMessage
message string The message text to send them.
member DiscordSharp.DiscordMember The member you want to send this to.
return DiscordSharp.DiscordMessage

UpdateBotStatus() public method

Updates the bot's status.
public UpdateBotStatus ( bool idle ) : void
idle bool True if you want the bot to report as idle.
return void

UpdateCurrentGame() public method

Updates the bot's 'Currently playing' status to the following text. Pass in null if you want to remove this.
public UpdateCurrentGame ( string gameName, bool streaming, string url = null ) : void
gameName string The game's name. Old gameid lookup can be seen at: http://hastebin.com/azijiyaboc.json/
streaming bool Whether or not you want your bot to appear as if it is streaming. True means it will show it's streaming.
url string The 'url' for the stream, if your bot is streaming.
return void

Property Details

GetLastVoiceClientLogger public property

Returns the last debug logger for when the voice client was last connected.
public Logger GetLastVoiceClientLogger
return Logger