Compare commits

..

No commits in common. "3a36799941cd741f3b98f0370423579001e7c09a" and "62319ebb1a21be5d746cb48cbfbc162a946e8d4f" have entirely different histories.

11 changed files with 14706 additions and 14721 deletions

View file

@ -149,7 +149,7 @@ public abstract class EllieContext : DbContext
.OnDelete(DeleteBehavior.Cascade);
// start antispam
modelBuilder.Entity<GuildConfig>()
.HasOne(x => x.AntiSpamSetting)
.WithOne()
@ -282,10 +282,10 @@ public abstract class EllieContext : DbContext
var selfassignableRolesEntity = modelBuilder.Entity<SelfAssignedRole>();
selfassignableRolesEntity.HasIndex(s => new
{
s.GuildId,
s.RoleId
})
{
s.GuildId,
s.RoleId
})
.IsUnique();
selfassignableRolesEntity.Property(x => x.Group).HasDefaultValue(0);
@ -358,10 +358,10 @@ public abstract class EllieContext : DbContext
var xps = modelBuilder.Entity<UserXpStats>();
xps.HasIndex(x => new
{
x.UserId,
x.GuildId
})
{
x.UserId,
x.GuildId
})
.IsUnique();
xps.HasIndex(x => x.UserId);
@ -407,9 +407,9 @@ public abstract class EllieContext : DbContext
.OnDelete(DeleteBehavior.SetNull);
ci.HasIndex(x => new
{
x.Name
})
{
x.Name
})
.IsUnique();
#endregion
@ -528,10 +528,10 @@ public abstract class EllieContext : DbContext
.IsUnique(false);
rr2.HasIndex(x => new
{
x.MessageId,
x.Emote
})
{
x.MessageId,
x.Emote
})
.IsUnique();
});
@ -606,11 +606,11 @@ public abstract class EllieContext : DbContext
{
// user can own only one of each item
x.HasIndex(model => new
{
model.UserId,
model.ItemType,
model.ItemKey
})
{
model.UserId,
model.ItemType,
model.ItemKey
})
.IsUnique();
});
@ -635,10 +635,10 @@ public abstract class EllieContext : DbContext
#region Sticky Roles
modelBuilder.Entity<StickyRole>(sr => sr.HasIndex(x => new
{
x.GuildId,
x.UserId
})
{
x.GuildId,
x.UserId
})
.IsUnique());
#endregion

View file

@ -4,14 +4,14 @@ using Microsoft.EntityFrameworkCore;
namespace EllieBot.Db;
public sealed class EllieDbService : DbService
public sealed class EllieDbService : DbService
{
private readonly IBotCredsProvider _creds;
// these are props because creds can change at runtime
private string DbType => _creds.GetCreds().Db.Type.ToLowerInvariant().Trim();
private string ConnString => _creds.GetCreds().Db.ConnectionString;
public EllieDbService(IBotCredsProvider creds)
{
LinqToDBForEFTools.Initialize();
@ -26,13 +26,13 @@ public sealed class EllieDbService : DbService
var connString = ConnString;
await using var context = CreateRawDbContext(dbType, connString);
// make sure sqlite db is in wal journal mode
if (context is SqliteContext)
{
await context.Database.ExecuteSqlRawAsync("PRAGMA journal_mode=WAL");
}
await context.Database.MigrateAsync();
}
@ -52,7 +52,7 @@ public sealed class EllieDbService : DbService
throw new NotSupportedException($"The database provide type of '{dbType}' is not supported.");
}
}
private EllieContext GetDbContextInternal()
{
var dbType = DbType;

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1192,8 +1192,6 @@ xpreset:
- xpreset
bible:
- bible
quran:
- quran
edit:
- edit
delete:

View file

@ -64,7 +64,7 @@ greetmsg:
desc: |-
Sets a new join announcement message which will be shown in the current channel.
Write `%user.mention%` if you want to mention the new member.
Full list of placeholders can be found here <https://docs.elliebot.net/ellie/features/placeholders/>
Full list of placeholders can be found here <https://docs.elliebot.net/ellie/placeholders/>
Using this command with no message will show the current greet message.
You can use embed json from <https://eb.elliebot.net/> instead of regular text, if you want the message to be embedded.
ex:
@ -82,7 +82,7 @@ byemsg:
desc: |-
Sets a new leave announcement message which will be shown in the current channel.
Type `%user.name%` to show the name of the user who left.
Full list of placeholders can be found here <https://docs.elliebot.net/ellie/features/placeholders/>
Full list of placeholders can be found here <https://docs.elliebot.net/ellie/placeholders/>
Using this command with no message will show the current bye message.
You can use embed json from <https://eb.elliebot.net/> instead of regular text, if you want the message to be embedded.
ex:
@ -138,7 +138,7 @@ boostmsg:
desc: |-
Sets a new boost announcement message which will be shown in the current channel.
Type `%user.mention%` if you want to mention the booster.
Full list of placeholders can be found here <https://docs.elliebot.net/ellie/features/placeholders/>
Full list of placeholders can be found here <https://docs.elliebot.net/ellie/placeholders/>
Using this command with no message will show the current boost message.
You can use embed json from <https://eb.elliebot.net/> instead of regular text, if you want the message to be embedded.
ex:
@ -378,7 +378,7 @@ iamnot:
- role:
desc: "The role to remove."
expradd:
desc: 'Add an expression with a trigger and a response. Bot will post a response whenever someone types the trigger word. Running this command in a server requires the Administrator permission. Running this command in DM is Bot Owner only and adds a new global expression. Guide [here](<https://docs.elliebot.net/ellie/features/expressions/>)'
desc: 'Add an expression with a trigger and a response. Bot will post a response whenever someone types the trigger word. Running this command in a server requires the Administrator permission. Running this command in DM is Bot Owner only and adds a new global expression. Guide [here](<https://docs.elliebot.net/ellie/expressions/>)'
ex:
- '"hello" Hi there %user.mention%'
params:
@ -387,7 +387,7 @@ expradd:
response:
desc: "The text of the message that shows up when a user types the trigger word."
expraddserver:
desc: 'Add an expression with a trigger and a response in this server. Bot will post a response whenever someone types the trigger word. This command is useful if you want to lower the permission requirement for managing expressions by using `{0}dpo`. Guide [here](<https://docs.elliebot.net/ellie/features/expressions/>).'
desc: 'Add an expression with a trigger and a response in this server. Bot will post a response whenever someone types the trigger word. This command is useful if you want to lower the permission requirement for managing expressions by using `{0}dpo`. Guide [here](<https://docs.elliebot.net/ellie/expressions/>).'
ex:
- '"hello" Hi there %user.mention%'
params:
@ -2180,7 +2180,7 @@ delallquotes:
- keyword:
desc: "The keyword to search for in the text."
greetdmmsg:
desc: Sets a new join announcement message which will be sent to the user who joined. Type `%user.mention%` if you want to mention the new member. Using it with no message will show the current DM greet message. You can use embed json from <https://eb.elliebot.net> instead of a regular text, if you want the message to be embedded.
desc: Sets a new join announcement message which will be sent to the user who joined. Type `%user.mention%` if you want to mention the new member. Using it with no message will show the current DM greet message. You can use embed json from <https://eb.elliebot.net/> instead of a regular text, if you want the message to be embedded.
ex:
- Welcome to the server, %user.mention%
params:
@ -2289,11 +2289,7 @@ emojiremove:
- emotes:
desc: "The list of emojis to be removed from the server."
stickeradd:
desc: |-
Adds the sticker from your message to this server.
Send the sticker along with this command (in the same message).
Alternatively you can upload an image along with this command but you have to specify the name.
The image must be 300x300 in .png or .apng format and up to 512KB in size.
desc: Adds the sticker from your message to this server. Send the sticker along with this command (in the same message).
ex:
- ''
- name "description" tag1 tag2 tagN
@ -4080,16 +4076,6 @@ bible:
desc: "The name of the biblical book being referenced."
chapterAndVerse:
desc: "The reference to a specific passage in the Bible, such as 'Genesis 3:15'"
quran:
desc: |-
Shows the text of an ayah of the Quran, as well as the recitation by Alafasy.
Supply surah:ayah, or ayah number. For instance, 262 or 2:255 will both get you Ayat Al Kursi
ex:
- 2:255
- 262
params:
- ayah:
desc: "The number of the ayah in the Quran, for example 2:255."
edit:
desc: Edits bot's message, you have to specify message ID and new text. You can optionally specify target channel. Supports embeds.
ex:
@ -4214,7 +4200,7 @@ marmaladeunload:
desc: "The name of a specific marmalade to be unloaded."
marmaladeinfo:
desc: |-
Shows information about the specified marmalade such as the author, name, description, list of canaries, number of commands etc.
Shows information about the specified marmalade such as the author, name, description, list of sneks, number of commands etc.
Provide no name to see the basic information about all loaded marmalades.
Read about the marmalade system [here](https://docs.elliebot.net/ellie/marmalade/creating-a-marmalade/)
ex:

View file

@ -1067,7 +1067,8 @@
"xpshop_already_owned": "You already own this item.",
"xpshop_item_not_found": "An item with that key doesn't exist.",
"xpshop_website": "You can see the list of all Xp Shop items here: <https://beta.elliebot.net>",
"sticker_error": "You must either send a sticker along with this command, or upload a 300x300 .png or .apng image. Up to 512KB in size.",
"sticker_invalid_size": "Stickers must be exactly 300x300 pixels.",
"sticker_error": "You must either send a sticker along with this command, or upload a 300x300 .png or .apng image.",
"sticker_missing_name": "Please specify a name for the sticker.",
"thread_deleted": "Thread Deleted",
"thread_created": "Thread Created",