mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-11-03 00:04:28 -05:00
Merge branch 'v3' of https://gitlab.com/kwoth/nadekobot into v3
This commit is contained in:
@@ -265,7 +265,15 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
if (amount <= 0)
|
if (amount <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
await _cs.AddAsync(usrId,
|
var usr = await ((DiscordSocketClient)Context.Client).Rest.GetUserAsync(usrId);
|
||||||
|
|
||||||
|
if(usr is null)
|
||||||
|
{
|
||||||
|
await ReplyErrorLocalizedAsync(strs.user_not_found).ConfigureAwait(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
await _cs.AddAsync(usr,
|
||||||
$"Awarded by bot owner. ({ctx.User.Username}/{ctx.User.Id}) {(msg ?? "")}",
|
$"Awarded by bot owner. ({ctx.User.Username}/{ctx.User.Id}) {(msg ?? "")}",
|
||||||
amount,
|
amount,
|
||||||
gamble: (ctx.Client.CurrentUser.Id != usrId)).ConfigureAwait(false);
|
gamble: (ctx.Client.CurrentUser.Id != usrId)).ConfigureAwait(false);
|
||||||
@@ -275,7 +283,7 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
[NadekoCommand, Aliases]
|
[NadekoCommand, Aliases]
|
||||||
[RequireContext(ContextType.Guild)]
|
[RequireContext(ContextType.Guild)]
|
||||||
[OwnerOnly]
|
[OwnerOnly]
|
||||||
[Priority(2)]
|
[Priority(3)]
|
||||||
public async Task Award(long amount, [Leftover] IRole role)
|
public async Task Award(long amount, [Leftover] IRole role)
|
||||||
{
|
{
|
||||||
var users = (await ctx.Guild.GetUsersAsync().ConfigureAwait(false))
|
var users = (await ctx.Guild.GetUsersAsync().ConfigureAwait(false))
|
||||||
|
|||||||
@@ -763,7 +763,7 @@ namespace NadekoBot.Modules.Music
|
|||||||
|
|
||||||
[NadekoCommand, Aliases]
|
[NadekoCommand, Aliases]
|
||||||
[RequireContext(ContextType.Guild)]
|
[RequireContext(ContextType.Guild)]
|
||||||
[RequireUserPermission(GuildPermission.Administrator)]
|
[UserPerm(GuildPerm.Administrator)]
|
||||||
public async Task MusicQuality()
|
public async Task MusicQuality()
|
||||||
{
|
{
|
||||||
var quality = await _service.GetMusicQualityAsync(ctx.Guild.Id);
|
var quality = await _service.GetMusicQualityAsync(ctx.Guild.Id);
|
||||||
@@ -772,7 +772,7 @@ namespace NadekoBot.Modules.Music
|
|||||||
|
|
||||||
[NadekoCommand, Aliases]
|
[NadekoCommand, Aliases]
|
||||||
[RequireContext(ContextType.Guild)]
|
[RequireContext(ContextType.Guild)]
|
||||||
[RequireUserPermission(GuildPermission.Administrator)]
|
[UserPerm(GuildPerm.Administrator)]
|
||||||
public async Task MusicQuality(QualityPreset preset)
|
public async Task MusicQuality(QualityPreset preset)
|
||||||
{
|
{
|
||||||
await _service.SetMusicQualityAsync(ctx.Guild.Id, preset);
|
await _service.SetMusicQualityAsync(ctx.Guild.Id, preset);
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ namespace NadekoBot.Modules.Utility
|
|||||||
[RequireContext(ContextType.Guild)]
|
[RequireContext(ContextType.Guild)]
|
||||||
public async Task QuoteDelete(int id)
|
public async Task QuoteDelete(int id)
|
||||||
{
|
{
|
||||||
var isAdmin = ((IGuildUser)ctx.Message.Author).GuildPermissions.ManageMessages;
|
var hasManageMessages = ((IGuildUser)ctx.Message.Author).GuildPermissions.ManageMessages;
|
||||||
|
|
||||||
var success = false;
|
var success = false;
|
||||||
string response;
|
string response;
|
||||||
@@ -216,7 +216,7 @@ namespace NadekoBot.Modules.Utility
|
|||||||
{
|
{
|
||||||
var q = uow.Quotes.GetById(id);
|
var q = uow.Quotes.GetById(id);
|
||||||
|
|
||||||
if ((q?.GuildId != ctx.Guild.Id) || (!isAdmin && q.AuthorId != ctx.Message.Author.Id))
|
if ((q?.GuildId != ctx.Guild.Id) || (!hasManageMessages && q.AuthorId != ctx.Message.Author.Id))
|
||||||
{
|
{
|
||||||
response = GetText(strs.quotes_remove_none);
|
response = GetText(strs.quotes_remove_none);
|
||||||
}
|
}
|
||||||
@@ -288,7 +288,7 @@ namespace NadekoBot.Modules.Utility
|
|||||||
|
|
||||||
[NadekoCommand, Aliases]
|
[NadekoCommand, Aliases]
|
||||||
[RequireContext(ContextType.Guild)]
|
[RequireContext(ContextType.Guild)]
|
||||||
[RequireUserPermission(GuildPermission.Administrator)]
|
[UserPerm(GuildPerm.Administrator)]
|
||||||
public async Task QuotesExport()
|
public async Task QuotesExport()
|
||||||
{
|
{
|
||||||
IEnumerable<Quote> quotes;
|
IEnumerable<Quote> quotes;
|
||||||
@@ -313,7 +313,7 @@ namespace NadekoBot.Modules.Utility
|
|||||||
|
|
||||||
[NadekoCommand, Aliases]
|
[NadekoCommand, Aliases]
|
||||||
[RequireContext(ContextType.Guild)]
|
[RequireContext(ContextType.Guild)]
|
||||||
[RequireUserPermission(GuildPermission.Administrator)]
|
[UserPerm(GuildPerm.Administrator)]
|
||||||
[Ratelimit(300)]
|
[Ratelimit(300)]
|
||||||
#if GLOBAL_NADEKO
|
#if GLOBAL_NADEKO
|
||||||
[OwnerOnly]
|
[OwnerOnly]
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ namespace NadekoBot.Modules.Utility
|
|||||||
|
|
||||||
[NadekoCommand, Aliases]
|
[NadekoCommand, Aliases]
|
||||||
[RequireContext(ContextType.Guild)]
|
[RequireContext(ContextType.Guild)]
|
||||||
[RequireUserPermission(GuildPermission.Administrator)]
|
[UserPerm(GuildPerm.Administrator)]
|
||||||
[Priority(0)]
|
[Priority(0)]
|
||||||
public Task RemindList(Server _, int page = 1)
|
public Task RemindList(Server _, int page = 1)
|
||||||
=> RemindList(page, true);
|
=> RemindList(page, true);
|
||||||
@@ -151,7 +151,7 @@ namespace NadekoBot.Modules.Utility
|
|||||||
|
|
||||||
[NadekoCommand, Aliases]
|
[NadekoCommand, Aliases]
|
||||||
[RequireContext(ContextType.Guild)]
|
[RequireContext(ContextType.Guild)]
|
||||||
[RequireUserPermission(GuildPermission.Administrator)]
|
[UserPerm(GuildPerm.Administrator)]
|
||||||
[Priority(0)]
|
[Priority(0)]
|
||||||
public Task RemindDelete(Server _, int index)
|
public Task RemindDelete(Server _, int index)
|
||||||
=> RemindDelete(index, true);
|
=> RemindDelete(index, true);
|
||||||
|
|||||||
@@ -284,24 +284,24 @@ namespace NadekoBot.Modules.Utility
|
|||||||
|
|
||||||
[NadekoCommand, Aliases]
|
[NadekoCommand, Aliases]
|
||||||
[RequireContext(ContextType.Guild)]
|
[RequireContext(ContextType.Guild)]
|
||||||
[RequireBotPermission(GuildPermission.ManageEmojis)]
|
[BotPerm(GuildPerm.ManageEmojis)]
|
||||||
[RequireUserPermission(GuildPermission.ManageEmojis)]
|
[UserPerm(GuildPerm.ManageEmojis)]
|
||||||
[Priority(2)]
|
[Priority(2)]
|
||||||
public Task EmojiAdd(string name, Emote emote)
|
public Task EmojiAdd(string name, Emote emote)
|
||||||
=> EmojiAdd(name, emote.Url);
|
=> EmojiAdd(name, emote.Url);
|
||||||
|
|
||||||
[NadekoCommand, Aliases]
|
[NadekoCommand, Aliases]
|
||||||
[RequireContext(ContextType.Guild)]
|
[RequireContext(ContextType.Guild)]
|
||||||
[RequireBotPermission(GuildPermission.ManageEmojis)]
|
[BotPerm(GuildPerm.ManageEmojis)]
|
||||||
[RequireUserPermission(GuildPermission.ManageEmojis)]
|
[UserPerm(GuildPerm.ManageEmojis)]
|
||||||
[Priority(1)]
|
[Priority(1)]
|
||||||
public Task EmojiAdd(Emote emote)
|
public Task EmojiAdd(Emote emote)
|
||||||
=> EmojiAdd(emote.Name, emote.Url);
|
=> EmojiAdd(emote.Name, emote.Url);
|
||||||
|
|
||||||
[NadekoCommand, Aliases]
|
[NadekoCommand, Aliases]
|
||||||
[RequireContext(ContextType.Guild)]
|
[RequireContext(ContextType.Guild)]
|
||||||
[RequireBotPermission(GuildPermission.ManageEmojis)]
|
[BotPerm(GuildPerm.ManageEmojis)]
|
||||||
[RequireUserPermission(GuildPermission.ManageEmojis)]
|
[UserPerm(GuildPerm.ManageEmojis)]
|
||||||
[Priority(0)]
|
[Priority(0)]
|
||||||
public async Task EmojiAdd(string name, string url = null)
|
public async Task EmojiAdd(string name, string url = null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ namespace NadekoBot.Modules.Xp
|
|||||||
|
|
||||||
[NadekoCommand, Aliases]
|
[NadekoCommand, Aliases]
|
||||||
[RequireContext(ContextType.Guild)]
|
[RequireContext(ContextType.Guild)]
|
||||||
[RequireUserPermission(GuildPermission.Administrator)]
|
[UserPerm(GuildPerm.Administrator)]
|
||||||
public async Task XpRewsReset()
|
public async Task XpRewsReset()
|
||||||
{
|
{
|
||||||
var reply = await PromptUserConfirmAsync(_eb.Create()
|
var reply = await PromptUserConfirmAsync(_eb.Create()
|
||||||
|
|||||||
@@ -611,7 +611,7 @@ quoteid:
|
|||||||
args:
|
args:
|
||||||
- "123456"
|
- "123456"
|
||||||
quotedelete:
|
quotedelete:
|
||||||
desc: "Deletes a quote with the specified ID. You have to be either server Administrator or the creator of the quote to delete it."
|
desc: "Deletes a quote with the specified ID. You have to either have the Manage Messages permission or be the creator of the quote to delete it."
|
||||||
args:
|
args:
|
||||||
- "123456"
|
- "123456"
|
||||||
draw:
|
draw:
|
||||||
|
|||||||
Reference in New Issue
Block a user