@@ -5,9 +5,6 @@ An unofficial .Net API Wrapper for the Discord client (http://discordapp.com).
Check out the [documentation](http://rtd.discord.foxbot.me/en/docs-dev/index.html) or join the [Discord API Chat](https://discord.gg/0SBTUU1wZTVjAMPx).
Check out the [documentation](http://rtd.discord.foxbot.me/en/docs-dev/index.html) or join the [Discord API Chat](https://discord.gg/0SBTUU1wZTVjAMPx).
##### Warning: Some of the documentation is outdated.
It's current being rewritten. Until that's done, feel free to use my [DiscordBot](https://github.com/RogueException/DiscordBot) repo for reference.
### Installation
### Installation
You can download Discord.Net and its extensions from NuGet:
You can download Discord.Net and its extensions from NuGet:
/// <summary> Gets or sets the time (in milliseconds) to wait after an unexpected disconnect before reconnecting. </summary>
/// <summary> Gets or sets the time (in milliseconds) to wait after an unexpected disconnect before reconnecting. </summary>
public int ReconnectDelay { get; set; } = 1000;
public int ReconnectDelay { get; set; } = 1000;
/// <summary> Gets or sets the time (in milliseconds) to wait after an reconnect fails before retrying. </summary>
/// <summary> Gets or sets the time (in milliseconds) to wait after an reconnect fails before retrying. </summary>
public int FailedReconnectDelay { get; set; } = 15000;
public int FailedReconnectDelay { get; set; } = 15000;
/// <summary> Gets or sets the number of messages per channel that should be kept in cache. Setting this to zero disables the message cache entirely. </summary>
/// <summary> Gets or sets the number of messages per channel that should be kept in cache. Setting this to zero disables the message cache entirely. </summary>
public int MessageCacheSize { get; set; } = 100;
public int MessageCacheSize { get; set; } = 100;
/// <summary>
/*/// <summary>
/// Gets or sets whether the permissions cache should be used.
/// Gets or sets whether the permissions cache should be used.
/// This makes operations such as User.GetPermissions(Channel), User.GuildPermissions, Channel.GetUser, and Channel.Members much faster while increasing memory usage.
/// This makes operations such as User.GetPermissions(Channel), User.GuildPermissions, Channel.GetUser, and Channel.Members much faster at the expense of increased memory usage.
/// </summary>
/// </summary>
public bool UsePermissionsCache { get; set; } = true;
public bool UsePermissionsCache { get; set; } = false;*/
/// <summary> Gets or sets whether the a copy of a model is generated on an update event to allow you to check which properties changed. </summary>
/// <summary> Gets or sets whether the a copy of a model is generated on an update event to allow you to check which properties changed. </summary>
public bool EnablePreUpdateEvents { get; set; } = true;
public bool EnablePreUpdateEvents { get; set; } = true;
public interface IGuild : IDeletable, ISnowflakeEntity, IUpdateable
public interface IGuild : IDeletable, ISnowflakeEntity, IUpdateable
{
{
/// <summary> Gets the name of this guild. </summary>
string Name { get; }
/// <summary> Gets the amount of time (in seconds) a user must be inactive in a voice channel for until they are automatically moved to the AFK voice channel, if one is set. </summary>
/// <summary> Gets the amount of time (in seconds) a user must be inactive in a voice channel for until they are automatically moved to the AFK voice channel, if one is set. </summary>
int AFKTimeout { get; }
int AFKTimeout { get; }
/// <summary> Returns true if this guild is embeddable (e.g. widget) </summary>
/// <summary> Returns true if this guild is embeddable (e.g. widget) </summary>
bool IsEmbeddable { get; }
bool IsEmbeddable { get; }
/// <summary> Gets the name of this guild. </summary>
string Name { get; }
int VerificationLevel { get; }
int VerificationLevel { get; }
/// <summary> Returns the url to this guild's icon, or null if one is not set. </summary>
string IconUrl { get; }
/// <summary> Returns the url to this guild's splash image, or null if one is not set. </summary>
string SplashUrl { get; }
/// <summary> Gets the id of the AFK voice channel for this guild if set, or null if not. </summary>
/// <summary> Gets the id of the AFK voice channel for this guild if set, or null if not. </summary>
ulong? AFKChannelId { get; }
ulong? AFKChannelId { get; }
@@ -21,22 +25,19 @@ namespace Discord
ulong DefaultChannelId { get; }
ulong DefaultChannelId { get; }
/// <summary> Gets the id of the embed channel for this guild if set, or null if not. </summary>
/// <summary> Gets the id of the embed channel for this guild if set, or null if not. </summary>
ulong? EmbedChannelId { get; }
ulong? EmbedChannelId { get; }
/// <summary> Gets the id of the role containing all users in this guild. </summary>
ulong EveryoneRoleId { get; }
/// <summary> Gets the id of the user that created this guild. </summary>
/// <summary> Gets the id of the user that created this guild. </summary>
ulong OwnerId { get; }
ulong OwnerId { get; }
/// <summary> Gets the id of the server region hosting this guild's voice channels. </summary>
/// <summary> Gets the id of the region hosting this guild's voice channels. </summary>
string VoiceRegionId { get; }
string VoiceRegionId { get; }
/// <summary> Returns the url to this server's icon, or null if one is not set. </summary>
string IconUrl { get; }
/// <summary> Returns the url to this server's splash image, or null if one is not set. </summary>
string SplashUrl { get; }
/// <summary> Gets the built-in role containing all users in this guild. </summary>
IRole EveryoneRole { get; }
/// <summary> Gets a collection of all custom emojis for this guild. </summary>
/// <summary> Gets a collection of all custom emojis for this guild. </summary>
IEnumerable<Emoji> Emojis { get; }
IReadOnlyCollection<Emoji> Emojis { get; }
/// <summary> Gets a collection of all extra features added to this guild. </summary>
/// <summary> Gets a collection of all extra features added to this guild. </summary>
IEnumerable<string> Features { get; }
IReadOnlyCollection<string> Features { get; }
/// <summary> Gets a collection of all roles in this guild. </summary>
IReadOnlyCollection<IRole> Roles { get; }
/// <summary> Modifies this guild. </summary>
/// <summary> Modifies this guild. </summary>
Task Modify(Action<ModifyGuildParams> func);
Task Modify(Action<ModifyGuildParams> func);
@@ -50,7 +51,7 @@ namespace Discord
Task Leave();
Task Leave();
/// <summary> Gets a collection of all users banned on this guild. </summary>
/// <summary> Gets a collection of all users banned on this guild. </summary>
Task<IEnumerable<IUser>> GetBans();
Task<IReadOnlyCollection<IUser>> GetBans();
/// <summary> Bans the provided user from this guild and optionally prunes their recent messages. </summary>
/// <summary> Bans the provided user from this guild and optionally prunes their recent messages. </summary>
Task AddBan(IUser user, int pruneDays = 0);
Task AddBan(IUser user, int pruneDays = 0);
/// <summary> Bans the provided user id from this guild and optionally prunes their recent messages. </summary>
/// <summary> Bans the provided user id from this guild and optionally prunes their recent messages. </summary>
@@ -61,7 +62,7 @@ namespace Discord
Task RemoveBan(ulong userId);
Task RemoveBan(ulong userId);
/// <summary> Gets a collection of all channels in this guild. </summary>
/// <summary> Gets a collection of all channels in this guild. </summary>
public override async Task<IReadOnlyCollection<IMessage>> GetMessages(ulong fromMessageId, Direction dir, int limit = DiscordConfig.MaxMessagesPerBatch)
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.