-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Got events just barely working, so far the only working event is "UserJoined", had to make a bunch of minor changes to things to make that work.
- Loading branch information
1 parent
7971f8c
commit c3a37e6
Showing
19 changed files
with
160 additions
and
62 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
using Newtonsoft.Json; | ||
using System; | ||
using System.IO; | ||
using System.Linq; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
using Discord.Commands; | ||
using Discord.WebSocket; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace Discord.json | ||
{ | ||
public class SocketEventContext : ICommandContext | ||
{ | ||
public DiscordSocketClient Client { get; } | ||
public SocketGuild Guild { get; } | ||
public ISocketMessageChannel Channel { get; } | ||
public SocketUser User { get; } | ||
public SocketUserMessage Message { get; } | ||
|
||
public bool IsPrivate => Channel is IPrivateChannel; | ||
|
||
public SocketEventContext(DiscordSocketClient client, SocketGuild guild) | ||
{ | ||
Client = client; | ||
Guild = guild; | ||
Channel = guild.DefaultChannel; | ||
} | ||
|
||
public SocketEventContext(DiscordSocketClient client, SocketGuildUser user) | ||
{ | ||
Client = client; | ||
Guild = user.Guild; | ||
Channel = user.Guild.DefaultChannel; | ||
User = user; | ||
} | ||
|
||
//ICommandContext | ||
IDiscordClient ICommandContext.Client => Client; | ||
IGuild ICommandContext.Guild => Guild; | ||
IMessageChannel ICommandContext.Channel => Channel; | ||
IUser ICommandContext.User => User; | ||
IUserMessage ICommandContext.Message => Message; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"user": "Context.User.Username", | ||
"user-name": "Context.User.Username", | ||
"user": "Context.User.Mention", | ||
"guild": "Context.Guild.Name" | ||
} |
Binary file not shown.
2 changes: 1 addition & 1 deletion
2
src/obj/Debug/netcoreapp2.1/Discord.json.csproj.CoreCompileInputs.cache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
8b9b3faa1965784bd980f396bcac7ebac9f7989c | ||
9a297fc2bf746ff33ff76604dbf5b235bf418e75 |
Binary file modified
BIN
+3.12 KB
(100%)
src/obj/Debug/netcoreapp2.1/Discord.json.csprojAssemblyReference.cache
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"version": 1, | ||
"dgSpecHash": "Wym/vBQUn0ukCzyHlvYd/HRcIgzsYJGAUx+8A03czho3gyGOiSWjAdFSQmQGL66MOJr/Y2BoSp8OjMvTbXU7IQ==", | ||
"dgSpecHash": "nH5wfO3r7TR9jL7bFyRNdbmHI7iYdvX8mDWQ0SxnTL/RiFYzY6K/Ulp7vxwI/eo20KBQE2Z5JcCc8QezgtKfRA==", | ||
"success": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters