-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f78ae9e
commit b8df775
Showing
18 changed files
with
203 additions
and
75 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace AnimeListBot.Handler.Database | ||
{ | ||
public class DatabaseTrancientService : DatabaseService, IDatabaseTrancientService | ||
{ | ||
public DatabaseTrancientService(DatabaseConnection db) : base (db) | ||
{ | ||
|
||
} | ||
|
||
public string GetServerPrefix(ulong guildId) | ||
{ | ||
DiscordServer server = dbConn.DiscordServer.Find(guildId); | ||
if(server != null) | ||
{ | ||
return server.Prefix; | ||
} | ||
return "al!"; | ||
} | ||
} | ||
} |
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,36 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace AnimeListBot.Handler.Database | ||
{ | ||
public interface IDatabaseService : IDisposable | ||
{ | ||
public List<DiscordServer> GetAllServers(); | ||
|
||
public List<DiscordUser> GetAllUsers(); | ||
|
||
public bool DoesServerIdExist(ulong id); | ||
|
||
public Task<DiscordServer> GetServerById(ulong id); | ||
|
||
public Task<bool> CreateServer(DiscordServer server); | ||
|
||
public Task<bool> RemoveServer(DiscordServer server); | ||
|
||
public Task<DiscordUser> GetUserById(ulong id, bool forceUpdate = false); | ||
|
||
public bool DoesUserIdExist(ulong id); | ||
|
||
public Task<bool> CreateUser(DiscordUser user); | ||
|
||
public Task<bool> RemoveUser(DiscordUser user); | ||
|
||
public Cluster GetCluster(int id); | ||
|
||
public List<Cluster> GetAllClusters(); | ||
|
||
public Task SaveChangesAsync(); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
AnimeListBot/Handler/Database/IDatabaseTrancientService.cs
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,11 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace AnimeListBot.Handler.Database | ||
{ | ||
public interface IDatabaseTrancientService : IDatabaseService | ||
{ | ||
public string GetServerPrefix(ulong guildId); | ||
} | ||
} |
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
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
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
Oops, something went wrong.