Now this should be ready to, I am the worst at git.
This commit is contained in:
@@ -33,36 +33,36 @@ namespace Discord.WebSocket
|
||||
remove { _messageReceivedEvent.Remove(value); }
|
||||
}
|
||||
private readonly AsyncEvent<Func<SocketMessage, Task>> _messageReceivedEvent = new AsyncEvent<Func<SocketMessage, Task>>();
|
||||
public event Func<ulong, Optional<SocketMessage>, Task> MessageDeleted
|
||||
public event Func<Cacheable<SocketMessage, ulong>, ISocketMessageChannel, Task> MessageDeleted
|
||||
{
|
||||
add { _messageDeletedEvent.Add(value); }
|
||||
remove { _messageDeletedEvent.Remove(value); }
|
||||
}
|
||||
private readonly AsyncEvent<Func<ulong, Optional<SocketMessage>, Task>> _messageDeletedEvent = new AsyncEvent<Func<ulong, Optional<SocketMessage>, Task>>();
|
||||
public event Func<Optional<SocketMessage>, SocketMessage, Task> MessageUpdated
|
||||
private readonly AsyncEvent<Func<Cacheable<SocketMessage, ulong>, ISocketMessageChannel, Task>> _messageDeletedEvent = new AsyncEvent<Func<Cacheable<SocketMessage, ulong>, ISocketMessageChannel, Task>>();
|
||||
public event Func<Cacheable<SocketMessage, ulong>, SocketMessage, ISocketMessageChannel, Task> MessageUpdated
|
||||
{
|
||||
add { _messageUpdatedEvent.Add(value); }
|
||||
remove { _messageUpdatedEvent.Remove(value); }
|
||||
}
|
||||
private readonly AsyncEvent<Func<Optional<SocketMessage>, SocketMessage, Task>> _messageUpdatedEvent = new AsyncEvent<Func<Optional<SocketMessage>, SocketMessage, Task>>();
|
||||
public event Func<ulong, Optional<SocketUserMessage>, SocketReaction, Task> ReactionAdded
|
||||
private readonly AsyncEvent<Func<Cacheable<SocketMessage, ulong>, SocketMessage, ISocketMessageChannel, Task>> _messageUpdatedEvent = new AsyncEvent<Func<Cacheable<SocketMessage, ulong>, SocketMessage, ISocketMessageChannel, Task>>();
|
||||
public event Func<Cacheable<SocketUserMessage, ulong>, ISocketMessageChannel, SocketReaction, Task> ReactionAdded
|
||||
{
|
||||
add { _reactionAddedEvent.Add(value); }
|
||||
remove { _reactionAddedEvent.Remove(value); }
|
||||
}
|
||||
private readonly AsyncEvent<Func<ulong, Optional<SocketUserMessage>, SocketReaction, Task>> _reactionAddedEvent = new AsyncEvent<Func<ulong, Optional<SocketUserMessage>, SocketReaction, Task>>();
|
||||
public event Func<ulong, Optional<SocketUserMessage>, SocketReaction, Task> ReactionRemoved
|
||||
private readonly AsyncEvent<Func<Cacheable<SocketUserMessage, ulong>, ISocketMessageChannel, SocketReaction, Task>> _reactionAddedEvent = new AsyncEvent<Func<Cacheable<SocketUserMessage, ulong>, ISocketMessageChannel, SocketReaction, Task>>();
|
||||
public event Func<Cacheable<SocketUserMessage, ulong>, ISocketMessageChannel, SocketReaction, Task> ReactionRemoved
|
||||
{
|
||||
add { _reactionRemovedEvent.Add(value); }
|
||||
remove { _reactionRemovedEvent.Remove(value); }
|
||||
}
|
||||
private readonly AsyncEvent<Func<ulong, Optional<SocketUserMessage>, SocketReaction, Task>> _reactionRemovedEvent = new AsyncEvent<Func<ulong, Optional<SocketUserMessage>, SocketReaction, Task>>();
|
||||
public event Func<ulong, Optional<SocketUserMessage>, Task> ReactionsCleared
|
||||
private readonly AsyncEvent<Func<Cacheable<SocketUserMessage, ulong>, ISocketMessageChannel, SocketReaction, Task>> _reactionRemovedEvent = new AsyncEvent<Func<Cacheable<SocketUserMessage, ulong>, ISocketMessageChannel, SocketReaction, Task>>();
|
||||
public event Func<Cacheable<SocketUserMessage, ulong>, ISocketMessageChannel, Task> ReactionsCleared
|
||||
{
|
||||
add { _reactionsClearedEvent.Add(value); }
|
||||
remove { _reactionsClearedEvent.Remove(value); }
|
||||
}
|
||||
private readonly AsyncEvent<Func<ulong, Optional<SocketUserMessage>, Task>> _reactionsClearedEvent = new AsyncEvent<Func<ulong, Optional<SocketUserMessage>, Task>>();
|
||||
private readonly AsyncEvent<Func<Cacheable<SocketUserMessage, ulong>, ISocketMessageChannel, Task>> _reactionsClearedEvent = new AsyncEvent<Func<Cacheable<SocketUserMessage, ulong>, ISocketMessageChannel, Task>>();
|
||||
|
||||
//Roles
|
||||
public event Func<SocketRole, Task> RoleCreated
|
||||
|
||||
@@ -303,11 +303,11 @@ namespace Discord.WebSocket
|
||||
client.ChannelUpdated += (oldChannel, newChannel) => _channelUpdatedEvent.InvokeAsync(oldChannel, newChannel);
|
||||
|
||||
client.MessageReceived += (msg) => _messageReceivedEvent.InvokeAsync(msg);
|
||||
client.MessageDeleted += (id, msg) => _messageDeletedEvent.InvokeAsync(id, msg);
|
||||
client.MessageUpdated += (oldMsg, newMsg) => _messageUpdatedEvent.InvokeAsync(oldMsg, newMsg);
|
||||
client.ReactionAdded += (id, msg, reaction) => _reactionAddedEvent.InvokeAsync(id, msg, reaction);
|
||||
client.ReactionRemoved += (id, msg, reaction) => _reactionRemovedEvent.InvokeAsync(id, msg, reaction);
|
||||
client.ReactionsCleared += (id, msg) => _reactionsClearedEvent.InvokeAsync(id, msg);
|
||||
client.MessageDeleted += (cache, channel) => _messageDeletedEvent.InvokeAsync(cache, channel);
|
||||
client.MessageUpdated += (oldMsg, newMsg, channel) => _messageUpdatedEvent.InvokeAsync(oldMsg, newMsg, channel);
|
||||
client.ReactionAdded += (cache, channel, reaction) => _reactionAddedEvent.InvokeAsync(cache, channel, reaction);
|
||||
client.ReactionRemoved += (cache, channel, reaction) => _reactionRemovedEvent.InvokeAsync(cache, channel, reaction);
|
||||
client.ReactionsCleared += (cache, channel) => _reactionsClearedEvent.InvokeAsync(cache, channel);
|
||||
|
||||
client.RoleCreated += (role) => _roleCreatedEvent.InvokeAsync(role);
|
||||
client.RoleDeleted += (role) => _roleDeletedEvent.InvokeAsync(role);
|
||||
|
||||
@@ -485,25 +485,25 @@ namespace Discord.WebSocket
|
||||
}
|
||||
}
|
||||
|
||||
public async Task SetStatus(UserStatus status)
|
||||
public async Task SetStatusAsync(UserStatus status)
|
||||
{
|
||||
Status = status;
|
||||
if (status == UserStatus.AFK)
|
||||
_statusSince = DateTimeOffset.UtcNow;
|
||||
else
|
||||
_statusSince = null;
|
||||
await SendStatus().ConfigureAwait(false);
|
||||
await SendStatusAsync().ConfigureAwait(false);
|
||||
}
|
||||
public async Task SetGame(string name, string streamUrl = null, StreamType streamType = StreamType.NotStreaming)
|
||||
public async Task SetGameAsync(string name, string streamUrl = null, StreamType streamType = StreamType.NotStreaming)
|
||||
{
|
||||
if (name != null)
|
||||
Game = new Game(name, streamUrl, streamType);
|
||||
else
|
||||
Game = null;
|
||||
CurrentUser.Presence = new SocketPresence(Status, Game);
|
||||
await SendStatus().ConfigureAwait(false);
|
||||
await SendStatusAsync().ConfigureAwait(false);
|
||||
}
|
||||
private async Task SendStatus()
|
||||
private async Task SendStatusAsync()
|
||||
{
|
||||
var game = Game;
|
||||
var status = Status;
|
||||
@@ -1205,8 +1205,9 @@ namespace Discord.WebSocket
|
||||
return;
|
||||
}
|
||||
|
||||
SocketUser user = State.GetUser(data.User.Id) ??
|
||||
(SocketUser) SocketSimpleUser.Create(this, State, data.User);
|
||||
SocketUser user = State.GetUser(data.User.Id);
|
||||
if (user == null)
|
||||
user = SocketSimpleUser.Create(this, State, data.User);
|
||||
await _userUnbannedEvent.InvokeAsync(user, guild).ConfigureAwait(false);
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user