mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-02 04:22:04 -04:00
WIP rehost stuff
This commit is contained in:
@@ -167,7 +167,6 @@ public class GetRandomImage : ICommand
|
|||||||
public async Task RunCommand(ChatBot botInstance, MessageModel message, UserDbModel user, GroupCollection arguments,
|
public async Task RunCommand(ChatBot botInstance, MessageModel message, UserDbModel user, GroupCollection arguments,
|
||||||
CancellationToken ctx)
|
CancellationToken ctx)
|
||||||
{
|
{
|
||||||
var logger = LogManager.GetCurrentClassLogger();
|
|
||||||
await using var db = new ApplicationDbContext();
|
await using var db = new ApplicationDbContext();
|
||||||
var key = arguments["key"].Value.ToLower();
|
var key = arguments["key"].Value.ToLower();
|
||||||
var images = db.Images.Where(i => i.Key == key);
|
var images = db.Images.Where(i => i.Key == key);
|
||||||
|
|||||||
@@ -75,6 +75,11 @@ public static class Zipline
|
|||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// public static async Task<string> RehostFile(string url)
|
||||||
|
// {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
public static async Task<bool> IsZiplineEnabled()
|
public static async Task<bool> IsZiplineEnabled()
|
||||||
{
|
{
|
||||||
var key = await SettingsProvider.GetValueAsync(BuiltIn.Keys.ZiplineKey);
|
var key = await SettingsProvider.GetValueAsync(BuiltIn.Keys.ZiplineKey);
|
||||||
|
|||||||
@@ -512,6 +512,11 @@ public static class BuiltIn
|
|||||||
public static string XeetEnabled = "Xeet.Enabled";
|
public static string XeetEnabled = "Xeet.Enabled";
|
||||||
[BuiltInSetting("Connection string for bot's Redis", SettingValueType.Text)]
|
[BuiltInSetting("Connection string for bot's Redis", SettingValueType.Text)]
|
||||||
public static string BotRedisConnectionString = "Bot.RedisConnectionString";
|
public static string BotRedisConnectionString = "Bot.RedisConnectionString";
|
||||||
|
[BuiltInSetting("Whether to automatically rehost images when they're added", SettingValueType.Boolean, "true",
|
||||||
|
BooleanRegex)]
|
||||||
|
public static string BotImageRehostEnabled = "Bot.Image.RehostEnabled";
|
||||||
|
[BuiltInSetting("Domain to look for when determining whether to rehost", SettingValueType.Text, "i.ddos.lgbt")]
|
||||||
|
public static string BotImageRehostDomain = "Bot.Image.RehostDomain";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user