feat: 新增抽象塔罗牌
|
@ -32,6 +32,7 @@ ai绘画:
|
||||||
watchPrefix: "/" #“看看”指令的前缀
|
watchPrefix: "/" #“看看”指令的前缀
|
||||||
运势&塔罗:
|
运势&塔罗:
|
||||||
lockLuck: false #是否锁定运势等功能的结果
|
lockLuck: false #是否锁定运势等功能的结果
|
||||||
|
isAbstract: false #是否启用抽象卡组
|
||||||
JMComic: #禁漫相关功能设置
|
JMComic: #禁漫相关功能设置
|
||||||
enable: True #全局开关
|
enable: True #全局开关
|
||||||
onlyTrustUser: False #打开后,仅master授权用户可用
|
onlyTrustUser: False #打开后,仅master授权用户可用
|
||||||
|
|
After Width: | Height: | Size: 90 KiB |
After Width: | Height: | Size: 108 KiB |
After Width: | Height: | Size: 119 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 35 KiB |
After Width: | Height: | Size: 97 KiB |
After Width: | Height: | Size: 56 KiB |
After Width: | Height: | Size: 154 KiB |
After Width: | Height: | Size: 39 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 127 KiB |
After Width: | Height: | Size: 160 KiB |
After Width: | Height: | Size: 117 KiB |
After Width: | Height: | Size: 106 KiB |
After Width: | Height: | Size: 68 KiB |
After Width: | Height: | Size: 25 KiB |
After Width: | Height: | Size: 114 KiB |
After Width: | Height: | Size: 59 KiB |
After Width: | Height: | Size: 160 KiB |
After Width: | Height: | Size: 99 KiB |
After Width: | Height: | Size: 35 KiB |
After Width: | Height: | Size: 24 KiB |
|
@ -90,12 +90,14 @@ tarot = [['
|
||||||
'The World.jpg']]
|
'The World.jpg']]
|
||||||
|
|
||||||
|
|
||||||
def tarotChoice():
|
def tarotChoice(isAbstract):
|
||||||
ints = random.randint(0, 1)
|
ints = random.randint(0, 1)
|
||||||
if ints == 0:
|
if ints == 0:
|
||||||
tarots = random.choice(tarot)
|
tarots = random.choice(tarot)
|
||||||
txt = tarots[0] + '\n' + 'Õýλ' + '\n' + tarots[1]
|
txt = tarots[0] + '\n' + 'Õýλ' + '\n' + tarots[1]
|
||||||
img = 'data/pictures/tarot/TarotImages/' + tarots[3]
|
img = 'data/pictures/tarot/TarotImages/' + tarots[3]
|
||||||
|
img_folder = 'AbstractImages' if isAbstract else 'TarotImages'
|
||||||
|
img = f'data/pictures/tarot/{img_folder}/{tarots[3]}'
|
||||||
return txt, img
|
return txt, img
|
||||||
if ints == 1:
|
if ints == 1:
|
||||||
tarots = random.choice(tarot)
|
tarots = random.choice(tarot)
|
||||||
|
@ -105,8 +107,11 @@ def tarotChoice():
|
||||||
return txt, img1
|
return txt, img1
|
||||||
else:
|
else:
|
||||||
# ´ò¿ªÍ¼Ïñ
|
# ´ò¿ªÍ¼Ïñ
|
||||||
img = Image.open('data/pictures/tarot/TarotImages/' + tarots[3])
|
img_folder = 'AbstractImages' if isAbstract else 'TarotImages'
|
||||||
|
img = Image.open(f'data/pictures/tarot/{img_folder}/{tarots[3]}')
|
||||||
|
|
||||||
|
if img.mode == 'RGBA':
|
||||||
|
img = img.convert('RGB')
|
||||||
# Ðýת180¶È
|
# Ðýת180¶È
|
||||||
rotated_img = img.rotate(180)
|
rotated_img = img.rotate(180)
|
||||||
|
|
||||||
|
|
|
@ -78,6 +78,7 @@ def main(bot, logger):
|
||||||
aiReplyCore = result1.get("chatGLM").get("aiReplyCore")
|
aiReplyCore = result1.get("chatGLM").get("aiReplyCore")
|
||||||
colorfulCharacterList = os.listdir("data/colorfulAnimeCharacter")
|
colorfulCharacterList = os.listdir("data/colorfulAnimeCharacter")
|
||||||
lockResult = controllerResult.get("运势&塔罗").get("lockLuck")
|
lockResult = controllerResult.get("运势&塔罗").get("lockLuck")
|
||||||
|
isAbstract = controllerResult.get("运势&塔罗").get("isAbstract")
|
||||||
InternetMeme = controllerResult.get("图片相关").get("InternetMeme")
|
InternetMeme = controllerResult.get("图片相关").get("InternetMeme")
|
||||||
|
|
||||||
global picData
|
global picData
|
||||||
|
@ -677,7 +678,7 @@ def main(bot, logger):
|
||||||
event.message_chain) == "今日塔罗":
|
event.message_chain) == "今日塔罗":
|
||||||
logger.info("获取今日塔罗")
|
logger.info("获取今日塔罗")
|
||||||
if not lockResult:
|
if not lockResult:
|
||||||
txt, img = tarotChoice()
|
txt, img = tarotChoice(isAbstract)
|
||||||
logger.info("成功获取到今日塔罗")
|
logger.info("成功获取到今日塔罗")
|
||||||
await bot.send(event, [txt, Image(path=img)])
|
await bot.send(event, [txt, Image(path=img)])
|
||||||
if aiReplyCore:
|
if aiReplyCore:
|
||||||
|
@ -687,7 +688,7 @@ def main(bot, logger):
|
||||||
|
|
||||||
else:
|
else:
|
||||||
if event.sender.id not in luckList.get(tod).get("塔罗"):
|
if event.sender.id not in luckList.get(tod).get("塔罗"):
|
||||||
txt, img = tarotChoice()
|
txt, img = tarotChoice(isAbstract)
|
||||||
logger.info("成功获取到今日塔罗")
|
logger.info("成功获取到今日塔罗")
|
||||||
await bot.send(event, txt)
|
await bot.send(event, txt)
|
||||||
await bot.send(event, Image(path=img))
|
await bot.send(event, Image(path=img))
|
||||||
|
|