-
Notifications
You must be signed in to change notification settings - Fork 32
Recent API Changes
This section will hopefully contain the most recent DiscordSharp changes that may or may not (but probably will) break your bot's code.
By default, WebSocket ready will now be compressed and will NOT contain offline users. If you wish to have offline users pulled on startup, set this boolean to true. Startup will take significantly longer.
The following changes have been recently made to the DiscordChannel
object.
-
DiscordChannel.name
->DiscordChannel.Name
-
DiscordChannel.topic
->DiscordChannel.Topic
-
DiscordChannel.id
->DiscordChannel.ID
-
DiscordChannel.icon
->DiscordChannel.Icon
-
DiscordChannel.type
->DiscordChannel.Type
-
DiscordChannel.Type
is now also an enum,ChannelType
with the following properties:Text
orVoice
.
The following changes have been made to various message deletion methods.
-
DeletePrivateMessage
has been removed. Use a regularDeleteMessage
-
DeleteMessage
now has an option to take a fullDiscordMessage
object. - You can still use the old method that goes by ID but, this only pulls message from the internal message log.
-
DeleteMessagesFromClientInChannel
has been removed. - If you want to delete more than 100 messages, do not use
DeleteMultipleMessagesInChannel
as this cuts off at 100.
Another misleading method now renamed.
It was a really misleading method name, I know. Thus, I have decided to replace it with an excellent alternative provided by contributor @Siegen. The new method is DeleteMultipleMessagesInChannel
and takes two arguments.
-
DiscordChannel
object -
int
count (max 100, if you try to put in over 100 the API will lower it to 100.
If you want to repeat this method go ahead. It's recommend you add some sleeping though to prevent rate limiting.
Due to the new channel base/inheritence system, you will now need to cast to the proper Discord Channel type yourself. There are only two types of DiscordChannel
s and you will need to pick the best depending on your situation.
-
DiscordChannel
- regular standard text/voice chat channel. -
DiscordPrivateChannel
- DM.
sry </3
DiscordRecipient
inside of DiscordPrivateChannel
has been replaced by the new/updated DiscordMember
object.
DiscordUser
is now obsolete. DiscordMember
will now house all of the properties associated with DiscordUser
. Please don't hate me.
-
DiscordUser.username
=>DiscordMember.Username
-
DiscordUser.id
=>DiscordMember.ID
-
DiscordUser.discriminator
=>DiscordMember.Discriminator
-
DiscordUser.avatar
=>DiscordMember.Avatar
(and two new functions associated with avatars, not tested though) -
DiscordUser.verified
=>DiscordMember.Verified
-
DiscordUser.email
=>DiscordMember.Email
-
DiscordUser.mute
=>DiscordMember.Muted
-
DiscordUser.deaf
=>DiscordMember.Deaf
Now, instead of needing to type e.user.username
to get the username, you can simply do e.Username
. DiscordMember
is still passed into functions unchanged.
All 3 of these methods now return a DiscordMessage
object.
owner_id
has been removed. Instead, please use DiscordServer.owner
which will return a DiscordMember
object of the owner of the server.
ChangeBotUsername
has been renamed to ChangeClientUsername
. Functionality is still the same.
ChangeBotInformation
has been renamed to ChangeClientInformation
. Functionality is still the same.
ChangeBotPicture
has been renamed to ChangeClientAvatar
. Functionality is still the same.
This event has been changed to TextClientDebugMessageReceived
. Internally, DiscordSharp has two separate loggers for the main text client and the new(ish) voice client. LoggerMessageReceivedArgs.message
should be replaced with LoggerMessageReceivedArgs.message.Message
to get the raw text. Alternatively, you can also get the level and timestamp associated with the debug message.