Class KuracordGuild
Implements
Inherited Members
Namespace: KSharpPlus.Entities.Guild
Assembly: KSharpPlus.dll
Syntax
public class KuracordGuild : SnowflakeObject
Properties
| Improve this Doc View SourceChannels
Gets a dictionary of all the channels associated with this guild. The dictionary's key is the channel ID.
Declaration
public IReadOnlyDictionary<ulong, KuracordChannel> Channels { get; }
Property Value
Type | Description |
---|---|
IReadOnlyDictionary<UInt64, KuracordChannel> |
Description
Gets the guild's description.
Declaration
public string Description { get; }
Property Value
Type | Description |
---|---|
String |
Disabled
Gets whether the guild is disabled.
Declaration
public bool Disabled { get; }
Property Value
Type | Description |
---|---|
Boolean |
IconHash
Gets the guild icon's hash.
Declaration
public string IconHash { get; }
Property Value
Type | Description |
---|---|
String |
IconUrl
Gets the guild icon's url.
Declaration
public string IconUrl { get; }
Property Value
Type | Description |
---|---|
String |
Members
Gets a dictionary of all the members that belong to this guild. The dictionary's key is the member ID.
Declaration
public IReadOnlyDictionary<ulong, KuracordMember> Members { get; }
Property Value
Type | Description |
---|---|
IReadOnlyDictionary<UInt64, KuracordMember> |
Name
Gets the guild's name.
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
String |
Owner
Gets the guild's owner.
Declaration
public KuracordUser Owner { get; }
Property Value
Type | Description |
---|---|
KuracordUser |
OwnerId
Gets the ID of the guild's owner.
Declaration
public ulong OwnerId { get; }
Property Value
Type | Description |
---|---|
UInt64 |
Roles
Gets a dictionary of all the roles associated with this guild. The dictionary's key is the role ID.
Declaration
public IReadOnlyDictionary<ulong, KuracordRole> Roles { get; }
Property Value
Type | Description |
---|---|
IReadOnlyDictionary<UInt64, KuracordRole> |
ShortName
Gets the guild's short name.
Declaration
public string ShortName { get; }
Property Value
Type | Description |
---|---|
String |
VanityCode
Gets the guild's vanity invite code.
Declaration
public string VanityCode { get; }
Property Value
Type | Description |
---|---|
String |
Methods
| Improve this Doc View SourceCreateChannelAsync(String, ChannelType)
Creates a new channel in this guild.
Declaration
public Task<KuracordChannel> CreateChannelAsync(string name, ChannelType type)
Parameters
Type | Name | Description |
---|---|---|
String | name | Name of the new channel. |
ChannelType | type | Type of the new channel. |
Returns
Type | Description |
---|---|
Task<KuracordChannel> | The newly-created channel. |
Exceptions
Type | Condition |
---|---|
UnauthorizedException | Thrown when the client does not have the Administrator permission. |
NotFoundException | Thrown when the guild does not exist. |
BadRequestException | Thrown when an invalid parameter was provided. |
ServerErrorException | Thrown when Kuracord is unable to process the request. |
CreateTextChannelAsync(String)
Creates a new text channel in this guild.
Declaration
public Task<KuracordChannel> CreateTextChannelAsync(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name | Name of the new channel. |
Returns
Type | Description |
---|---|
Task<KuracordChannel> | The newly-created channel. |
Exceptions
Type | Condition |
---|---|
UnauthorizedException | Thrown when the client does not have the Administrator permission. |
NotFoundException | Thrown when the guild does not exist. |
BadRequestException | Thrown when an invalid parameter was provided. |
ServerErrorException | Thrown when Kuracord is unable to process the request. |
DeleteAsync(String)
Deletes this guild. Requires the caller to be the owner of the guild.
Declaration
public Task DeleteAsync(string password)
Parameters
Type | Name | Description |
---|---|---|
String | password | Your account password. |
Returns
Type | Description |
---|---|
Task |
Exceptions
Type | Condition |
---|---|
UnauthorizedException | Thrown when the client is not the owner of the guild. |
ServerErrorException | Thrown when Kuracord is unable to process the request. |
Equals(KuracordGuild)
Checks whether this KuracordGuild is equal to another KuracordGuild.
Declaration
public bool Equals(KuracordGuild e)
Parameters
Type | Name | Description |
---|---|---|
KuracordGuild | e | KuracordGuild to compare to. |
Returns
Type | Description |
---|---|
Boolean | Whether the KuracordGuild is equal to this KuracordGuild. |
Equals(Object)
Checks whether this KuracordGuild is equal to another object.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj | Object to compare to. |
Returns
Type | Description |
---|---|
Boolean | Whether the object is equal to this KuracordGuild. |
Overrides
| Improve this Doc View SourceGetChannelAsync(UInt64)
Gets a channel from this guild by its ID.
Declaration
public async Task<KuracordChannel> GetChannelAsync(ulong channelId)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | channelId | ID of the channel to get. |
Returns
Type | Description |
---|---|
Task<KuracordChannel> | Requested channel. |
Exceptions
Type | Condition |
---|---|
ServerErrorException | Thrown when Kuracord is unable to process the request. |
GetChannelsAsync()
Gets all the channels this guild has.
Declaration
public Task<IReadOnlyList<KuracordChannel>> GetChannelsAsync()
Returns
Type | Description |
---|---|
Task<IReadOnlyList<KuracordChannel>> | A collection of this guild's channels. |
Exceptions
Type | Condition |
---|---|
ServerErrorException | Thrown when Kuracord is unable to process the request. |
GetHashCode()
Gets the hash code for this KuracordGuild.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 | The hash code for this KuracordGuild. |
Overrides
| Improve this Doc View SourceGetIconUrl()
Gets guild's icon URL.
Declaration
public string GetIconUrl()
Returns
Type | Description |
---|---|
String | The URL of the guild's icon. |
GetMemberAsync(UInt64)
Gets a member of this guild by their ID.
Declaration
public async Task<KuracordMember> GetMemberAsync(ulong memberId)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | memberId | ID of the member to get. |
Returns
Type | Description |
---|---|
Task<KuracordMember> | The requested member. |
Exceptions
Type | Condition |
---|---|
ServerErrorException | Thrown when Kuracord is unable to process the request. |
GetMembersAsync()
Retrieves a full list of members from Kuracord. This method will bypass cache.
Declaration
public async Task<IReadOnlyList<KuracordMember>> GetMembersAsync()
Returns
Type | Description |
---|---|
Task<IReadOnlyList<KuracordMember>> | A collection of all members in this guild. |
Exceptions
Type | Condition |
---|---|
ServerErrorException | Thrown when Kuracord is unable to process the request. |
GetRole(UInt64)
Gets a role from this guild by its ID.
Declaration
public KuracordRole GetRole(ulong roleId)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | roleId | ID of the role to get. |
Returns
Type | Description |
---|---|
KuracordRole | Requested role or null if the role does not exists. |
LeaveAsync()
Leaves this guild.
Declaration
public Task LeaveAsync()
Returns
Type | Description |
---|---|
Task |
Exceptions
Type | Condition |
---|---|
ServerErrorException | Thrown when Kuracord is unable to process the request. |
ModifyAsync(String)
Modifies this guild.
Declaration
public Task<KuracordGuild> ModifyAsync(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name | New guild name. |
Returns
Type | Description |
---|---|
Task<KuracordGuild> | The modified guild object. |
Exceptions
Type | Condition |
---|---|
UnauthorizedException | Thrown when the client does not have the Administrator permission. |
NotFoundException | Thrown when the guild does not exist. |
BadRequestException | Thrown when an invalid parameter was provided. |
ServerErrorException | Thrown when Kuracord is unable to process the request. |
ModifyMemberAsync(KuracordMember, String)
Modifies the member.
Declaration
public Task<KuracordMember> ModifyMemberAsync(KuracordMember member, string nickname)
Parameters
Type | Name | Description |
---|---|---|
KuracordMember | member | Member to modify. |
String | nickname | New member nickname. |
Returns
Type | Description |
---|---|
Task<KuracordMember> | Modified member. |
Exceptions
Type | Condition |
---|---|
UnauthorizedException | Thrown when the client does not have the Administrator permission. |
NotFoundException | Thrown when the member does not exist. |
BadRequestException | Thrown when an invalid parameter was provided. |
ServerErrorException | Thrown when Kuracord is unable to process the request. |
ModifyMemberAsync(UInt64, String)
Modifies the member.
Declaration
public Task<KuracordMember> ModifyMemberAsync(ulong memberId, string nickname)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | memberId | ID of the member to modify. |
String | nickname | New member nickname. |
Returns
Type | Description |
---|---|
Task<KuracordMember> | Modified member. |
Exceptions
Type | Condition |
---|---|
UnauthorizedException | Thrown when the client does not have the Administrator permission. |
NotFoundException | Thrown when the member does not exist. |
BadRequestException | Thrown when an invalid parameter was provided. |
ServerErrorException | Thrown when Kuracord is unable to process the request. |
RemoveMemberAsync(KuracordMember)
Kicks the member from this guild.
Declaration
public Task RemoveMemberAsync(KuracordMember member)
Parameters
Type | Name | Description |
---|---|---|
KuracordMember | member | The member to kick. |
Returns
Type | Description |
---|---|
Task |
Exceptions
Type | Condition |
---|---|
UnauthorizedException | Thrown when the client does not have the KickMembers permission. |
NotFoundException | Thrown when the member does not exist. |
BadRequestException | Thrown when an invalid parameter was provided. |
ServerErrorException | Thrown when Kuracord is unable to process the request. |
RemoveMemberAsync(UInt64)
Kicks the member from this guild.
Declaration
public Task RemoveMemberAsync(ulong memberId)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | memberId | ID of the member to kick. |
Returns
Type | Description |
---|---|
Task |
Exceptions
Type | Condition |
---|---|
UnauthorizedException | Thrown when the client does not have the KickMembers permission. |
NotFoundException | Thrown when the member does not exist. |
BadRequestException | Thrown when an invalid parameter was provided. |
ServerErrorException | Thrown when Kuracord is unable to process the request. |
SendMessageAsync(KuracordChannel, String)
Sends a message
Declaration
public Task<KuracordMessage> SendMessageAsync(KuracordChannel channel, string content)
Parameters
Type | Name | Description |
---|---|---|
KuracordChannel | channel | Channel to send to. |
String | content | Message content to send. |
Returns
Type | Description |
---|---|
Task<KuracordMessage> | The Kuracord Message that was sent. |
Exceptions
Type | Condition |
---|---|
UnauthorizedException | Thrown when the client does not have the SendMessages permission. |
NotFoundException | Thrown when the channel does not exist. |
BadRequestException | Thrown when an invalid parameter was provided. |
ServerErrorException | Thrown when Kuracord is unable to process the request. |
SendMessageAsync(UInt64, String)
Sends a message
Declaration
public Task<KuracordMessage> SendMessageAsync(ulong channelId, string content)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | channelId | ID of the channel to send to. |
String | content | Message content to send. |
Returns
Type | Description |
---|---|
Task<KuracordMessage> | The Kuracord Message that was sent. |
Exceptions
Type | Condition |
---|---|
UnauthorizedException | Thrown when the client does not have the SendMessages permission. |
NotFoundException | Thrown when the channel does not exist. |
BadRequestException | Thrown when an invalid parameter was provided. |
ServerErrorException | Thrown when Kuracord is unable to process the request. |
ToString()
Returns a string representation of this guild.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | String representation of this guild. |
Overrides
Operators
| Improve this Doc View SourceEquality(KuracordGuild, KuracordGuild)
Gets whether the two KuracordGuild objects are equal.
Declaration
public static bool operator ==(KuracordGuild e1, KuracordGuild e2)
Parameters
Type | Name | Description |
---|---|---|
KuracordGuild | e1 | First member to compare. |
KuracordGuild | e2 | Second member to compare. |
Returns
Type | Description |
---|---|
Boolean | Whether the two members are equal. |
Inequality(KuracordGuild, KuracordGuild)
Gets whether the two KuracordGuild objects are not equal.
Declaration
public static bool operator !=(KuracordGuild e1, KuracordGuild e2)
Parameters
Type | Name | Description |
---|---|---|
KuracordGuild | e1 | First member to compare. |
KuracordGuild | e2 | Second member to compare. |
Returns
Type | Description |
---|---|
Boolean | Whether the two members are not equal. |