diff --git a/Roboto-Bold.ttf b/Roboto-Bold.ttf new file mode 100644 index 0000000..8869666 Binary files /dev/null and b/Roboto-Bold.ttf differ diff --git a/StormBrigade_White.png b/StormBrigade_White.png new file mode 100644 index 0000000..cd6bf6a Binary files /dev/null and b/StormBrigade_White.png differ diff --git a/__pycache__/bingo.cpython-310.pyc b/__pycache__/bingo.cpython-310.pyc new file mode 100644 index 0000000..bc2298b Binary files /dev/null and b/__pycache__/bingo.cpython-310.pyc differ diff --git a/__pycache__/botOptions.cpython-310.pyc b/__pycache__/botOptions.cpython-310.pyc new file mode 100644 index 0000000..7992a3f Binary files /dev/null and b/__pycache__/botOptions.cpython-310.pyc differ diff --git a/__pycache__/embed_factory.cpython-310.pyc b/__pycache__/embed_factory.cpython-310.pyc new file mode 100644 index 0000000..e5e79ff Binary files /dev/null and b/__pycache__/embed_factory.cpython-310.pyc differ diff --git a/__pycache__/helpers.cpython-310.pyc b/__pycache__/helpers.cpython-310.pyc new file mode 100644 index 0000000..b1012c3 Binary files /dev/null and b/__pycache__/helpers.cpython-310.pyc differ diff --git a/__pycache__/modals.cpython-310.pyc b/__pycache__/modals.cpython-310.pyc new file mode 100644 index 0000000..8204475 Binary files /dev/null and b/__pycache__/modals.cpython-310.pyc differ diff --git a/__pycache__/sbComponents.cpython-310.pyc b/__pycache__/sbComponents.cpython-310.pyc new file mode 100644 index 0000000..2a8f9ca Binary files /dev/null and b/__pycache__/sbComponents.cpython-310.pyc differ diff --git a/__pycache__/sbclasses.cpython-310.pyc b/__pycache__/sbclasses.cpython-310.pyc new file mode 100644 index 0000000..dbdad06 Binary files /dev/null and b/__pycache__/sbclasses.cpython-310.pyc differ diff --git a/background.png b/background.png new file mode 100644 index 0000000..345095e Binary files /dev/null and b/background.png differ diff --git a/bingo.py b/bingo.py new file mode 100644 index 0000000..b6e77c3 --- /dev/null +++ b/bingo.py @@ -0,0 +1,169 @@ +from cgi import test +from cmath import pi +from tkinter import CENTER +from PIL import Image, ImageDraw, ImageFont, ImagePath +import textwrap +import botOptions +import random +import math +import time + +watermarkFont = ImageFont.truetype('Roboto-Bold.ttf',120) +textFont = ImageFont.truetype('Roboto-Bold.ttf',23) + +def generate_bingo(playerName,seed): + random.seed(seed) + background = Image.open('background.png') + midground = Image.open('midground.png') + draw = ImageDraw.Draw(background) + #Draw Watermark + draw.text((500,1000),playerName,font=watermarkFont,fill=(100,0,0),anchor='mb') + background.paste(midground,(0,0),midground) + selectedTasks = random.sample(botOptions.alternatives,25) + for x in range(0,5): + for y in range(0,5): + + wrapText = textwrap.fill(text=selectedTasks.pop(),width=13) + draw.multiline_text((137+(180*x),267+(180*y)),wrapText,font=textFont,fill=(0,0,0,),anchor='mm',align=CENTER) + return background + +def generate_gif_test(displayname,tier): + images = [] + frameCount = 80 + startAngle = random.random()*720 + im = Image.new("RGBA", (582, 582), (44, 47, 51,255)) + wheelGenResult = drawWheel(tier) + wheel = wheelGenResult[0] + endAngle = (startAngle+(10*(frameCount-1)))%360 + #print(endAngle) + targetAngle = 180-endAngle + #Calculate winning segment + if endAngle > 180: + targetAngle = 360 - endAngle + 180 + #print(wheelGenResult) + #print(targetAngle) + for n,seg in enumerate(wheelGenResult[1]): + if seg[0]+seg[1] > targetAngle: + reward = getTierAwards(tier)[n][2] + #print(reward) + break + + dot = Image.open('dot.png') + + for n in range(0,frameCount): + frame = im.copy() + draw = ImageDraw.Draw(frame) + + + rotwheel = wheel.rotate(startAngle+(n*10)) + rotwheel.paste(dot,(0,0),dot) + frame.paste(rotwheel,(0,0),rotwheel) + images.append(frame) + c=im.width/2 + #draw.line((c,c)+(c+250*math.sin((endAngle)/180*pi),c+250*math.cos((endAngle)/180*pi))) + images[0].save(displayname+'.gif', + save_all=True, + append_images=images[1:], + duration=22, + loop=1) + return reward + +def getTierAwards(number): + #imageIcons + #Tier one + tier1 = [ + (0,Image.open('resources/1kweps.png'),"1000 Weapons"), + (0,Image.open('resources/250kgold.png'),"250k Parish Gold"), + (0,Image.open('resources/250cat.png'),"250 Catapults"), + (0,Image.open('resources/100kpitch.png'),"100k Pitch"), + (0,Image.open('resources/fullbanquet.png'),"2700 Banqueting Goods"), + (10,Image.open('resources/t2.png'),"T2") + ] + #Tier two + tier2 = [ + (0,Image.open('resources/500kgold.png'),"500k Parish Gold"), + (0,Image.open('resources/500cat.png'),"500 Catapults"), + (0,Image.open('resources/2kweps.png'),"2000 Weapons"), + (6,Image.open('resources/t3.png'),"T3") + ] + #Tier three + tier3 = [ + (0,Image.open('resources/1mgold.png'),"1MILLION GOLD"), + (0,Image.open('resources/1kcat.png'),"1000 Catapults"), + (0,Image.open('resources/3kweps.png'),"3000 Weapons"), + (0,Image.open('resources/5crowns.png'),"$5 Crown Gift") + ] + if number >= 3: + return tier3 + elif number == 2: + return tier2 + else: + return tier1 + + +def drawWheel(tier): + awards = getTierAwards(tier) + im = Image.new("RGBA", (582, 582), (44, 47, 51,0)) + c = im.width/2 + radius = 290 + segments = [] + + #generate segment sizes + fairChance = 100 + specials = 0 + circleCheck = 0 + for a in awards: + if a[0] > 0: + fairChance -= a[0] + specials +=1 + + for award in awards: + #set arclengths + if award == awards[-1]: + arc = 360-circleCheck + circleCheck += arc + segments.append((arc,award)) + break + if award[0] == 0: + arc = int((361*fairChance/100)/(len(awards)-specials)) + circleCheck += arc + segments.append((arc,award)) + else: + arc = int(361*award[0]/100) + circleCheck += arc + segments.append((arc,award)) + + polygons = [] + iconPositions = [] + sectorAreas = [] + sectorStart = 0 + for seg in segments: + sectorSize = seg[0] + polygons.append(drawSegmentVector(sectorStart,sectorSize,c,radius)) + sectorAreas.append((sectorStart,sectorSize)) + iconPositions.append(int(sectorStart+(sectorSize/2))) + sectorStart += seg[0] + imdraw = ImageDraw.Draw(im) + #selectedColors = random.sample(circleColors,len(polygons)) + for polys in polygons: + imdraw.polygon(polys,fill=random.choice(botOptions.circleColors),outline='black') + #add icons to center of segment + for index,iconArc in enumerate(iconPositions): + icon = awards[index][1] + rotIcon = icon.rotate(iconArc-180) + imgSize = icon.size + + im.paste(rotIcon,(int(c+(radius*0.75)*math.sin((iconArc)/180*pi))-int(imgSize[0]/2),int(c+(radius*0.75)*math.cos((iconArc)/180*pi))-int(imgSize[1]/2)),mask=rotIcon) + #im.show() + return((im,sectorAreas)) + + +def drawSegmentVector(arcStart,arcLength,center,radius): + vectors = [] + vectors.append((center,center)) #Start in center + for a in range(0,arcLength+1): + vectors.append((center+radius*math.sin((a+arcStart)/180*pi),center+radius*math.cos((a+arcStart)/180*pi))) + vectors.append((center,center)) #End in center + return vectors + +#generate_gif_test("test",1) \ No newline at end of file diff --git a/botOptions.py b/botOptions.py new file mode 100644 index 0000000..ec37139 --- /dev/null +++ b/botOptions.py @@ -0,0 +1,134 @@ +verifiedUsers = [194754951547715585,273918567018397697,140988518515212288] +prefix = '%' + +alternatives = [ +"Kill an AI in a parish you do not own", +"Raze a village off a player in H13 Bravo", +"Raze a village off a player in Green Machine", +"Raze a village off a player in League of Nations", +"Raze a village off a player in Brothers of the Knighthood", +"Raze a village off a player in The Irish Knights", +"Raze a village off a player in Band of the Red Hand", +"Raze a village off a player in THE PINK FLUFFY UNICORNS", +"Raze a village off a player in THE PINK FLUFFY UNICORNS INC", +"Raze a village off a player in prisoners of war", +"Raze a village off a player in Wind of the Iron Fists", +"Raze a village off a player in The Unforgiven", +"Raze a village off a player in Godz", +"Raze a village off a player in Royal FLush", +"Raze a village off a player in THE RIZEN", +"Raze a village off a player in The Insane Squirrels", +"Raze a village off a player in The Loyal Ones", +"Raze a village off a player in DYWIZION 303", +"Raze H3 HM Lord Perrin", +"Raze H10 HM KingJohn1743", +"Raze H13 HM Amber_Rose", +"Raze H14 HM War_Ghost", +"Raze H17 HM Tasakpol", +"Raze H4 HM richardhood", +"Raze H3 FG Lord Perrin", +"Raze H3 FG bigbucki", +"Raze H3 FG sir william 2", +"Raze H10 FG BlaCK-NeKR", +"Raze H10 FG KingJohn1743", +"Raze H10 FG andracoz", +"Raze H14 FG Lord Darko900", +"Raze H14 FG War_Ghost", +"Raze H14 FG Lady Carl", +"Raze H17 FG Tasakpol", +"Raze H17 FG Peps", +"Raze H17 FG johndex", +"Raze H13 FG Amber_Rose", +"Raze H13 FG Sweet69", +"Raze H13 FG Dovis7", +"Raze H4 FG richardhood", +"Raze H4 FG mcguyber Ill", +"Raze local dumbass WinNytHepOOh89", +"Raze a pot monster (150 pots minimum)", +"Absolve a teammate", +"Flip an enemy county neutral", +"Flip a parish from enemy to ally", +"Send 100 salt to german71", +"Send or participate in a bomb base on a target", +"Raze a village with at least 3 vassals", +"Capture an enemy village with a fully loaded vassal", +"Kill 5 irish rats", +"Kill 5 english rats", +"Kill 5 welsh rats", +"Receive A County Proclamation", +"Message an SB player you have never talked to before", +"Heal 200 disease not in your own parish", +"Send 150 Catapult reinforcements to an allied breaker seat", +"Fill one empty vassal to 500 troops", +"Successfully scout a spice stash", +"Call out an H13/H4 player not sitting on ID", +"Call out an H3/10/14 player not sitting on ID", +"Call out an H17 player not sitting on ID", +"Fulfill a request in Ask and Give", +"Make a request in Ask and Give channel", +"Unlock an achievement", +"Collect 3 treasure-castle chests", +"Raze an H13 village", +"Raze an H4 village", +"Raze an H3 village", +"Raze an H10 village", +"Raze an H14 village", +"Raze an H17 village", +"Capture an H3 village", +"Capture an H10 village", +"Capture an H14 village", +"Capture an H17 village", +"Capture an H13 village", +"Capture an H4 village", +"Successfully defend against an H13/4 attack", +"Successfully defend against an H3/10/14 attack", +"Successfully defend against an H17 attack", +"Post your castle in Castle-Designs on Discord", +"Add a friend on Discord", +"Spot marksdad talking about apples", +"Successfully scout a fish stash", +"Experience Heavy Rain -24", +"Experience Sunny Spells +12", +"Upgrade a parish building", +"Talk to someone in voice chat on Discord", +"Get a gold (or rarer) daily card", +"Get a CASTLE daily card", +"Get an ARMY daily card", +"Get a BANQUETING GOODS Daily Card", +"Get an SPECIALIST daily card", +"Get a FOOD based daily card", +"Lose a vassal", +"Get a RESOURCES daily card", +"LL someone on our Discord", +"Complete a quest", +"Approach someone in SB w/Wolf-castle & offer to remove it- remove it", +"Send some interdiction to an SB vassal hub", +"Turn tax to 9x and leave it on", +"Send Bglizard (at least) 2000 fish", +"Ask your FG what you can do to help", +"Experience someone scouting your stash before you do", +"Play Improved Guardhouses and put troops up in your towns", +"Get a WEAPONS daily card", +"Spot more than 40 people online at once on Discord", +"1-shot a Wolf AI", +"Lose a tower to AI attack", +"Rank up without losing any LL", +"Experience someone killing Rat AI in your parish", +"Experience someone killing Paladin AI in your parish", +"Experience someone killing Snake AI in your parish", +"Talk to someone in a different house on your Discord", +"Someone from a different house on Discord talks to you" +] + + +circleColors = [ + (15,159,251), + (36,139,205), + (4,100,161), + (68,182,254), + (0,180,255), + (0,97,159), + (62,120,180), + (149,195,242) +] + diff --git a/dot.png b/dot.png new file mode 100644 index 0000000..aacde1e Binary files /dev/null and b/dot.png differ diff --git a/embed_factory.py b/embed_factory.py new file mode 100644 index 0000000..a3196f6 --- /dev/null +++ b/embed_factory.py @@ -0,0 +1,66 @@ +import disnake +import requests +import datetime +import time +from helpers import sql_get +def lfll(parent): + embed = disnake.Embed(title="Looking for Liege Lords") + embed.description = "List of people looking for LL, use /LL anywhere you you have access to add to this list!\n **Open the thread below and ✅ the requests that you fulfill**" + requests = sql_get("SELECT * FROM llrequests WHERE parentID = {parentID} AND fulfilled = '0'".format(parentID=parent)) + if len(requests) > 0: + users = {} + userCP = {} + for entries in requests: + if entries[7] in users.keys(): + if entries[4] > userCP[entries[7]]: + userCP[entries[7]] = entries[4] + users[entries[7]].append(entries[2]) + else: + users[entries[7]] = [entries[2]] + userCP[entries[7]] = entries[4] + for name,user in users.items(): + field_body = "" + for villa in user: + field_body += ">{villa}\n".format(villa=villa) + embed.add_field(name="{name} CP:{cp}".format(name=name,cp=userCP[name]),value=field_body) + + return embed + +def check_player(user): + activity = requests.get('https://shk.azure-api.net/shkinfo/v1/UserActivity?world=World%202&username={user}&Key=5E78CFC8-1FFA-4036-8427-D94ED6E1A45B&subscription-key=ff2e578e119348ea8b48a2acd2f5a48d'.format(user=user)) + banStatus = requests.get('http://login.strongholdkingdoms.com/ajaxphp/username_search.php?term={user}'.format(user=user)) + shield = requests.get('https://login.strongholdkingdoms.com/ajaxphp/get_shield_url.php?username={user}&transparent=1'.format(user=user)) + print(banStatus.text) + banned = "Account is **BANNED**" + act = "Error" + shieldURL='' + known = False + if 'error' not in shield.json().keys(): + shieldURL = shield.json()['url'] + known = True + if len(banStatus.text) == 2: + banned = "Account is **BANNED**" + if not known: + banned = "Account is unknown, typo?" + + else: + result = banStatus.json() + check = user.lower() + if check in (string.lower() for string in result): + banned = "**NOT** Banned" + if activity.text == '01/Jan/0001 00:00:00': + print("Unknown player") + act = "-No W2 Data-" + else: + date = datetime.datetime.strptime(activity.text,'%d/%b/%Y %H:%M:%S') + print(date) + act = ''.format(t1=int(date.timestamp())) + embed = disnake.Embed(title="{user}'s info".format(user=user)) + embed.description = "Generated \nCurrent avaliable info is:".format(user=user,t1=int(time.time())) + embed.add_field(name="Last Activity",value = act) + embed.add_field(name="Status",value=banned) + if shieldURL == '': + embed.set_thumbnail(file=disnake.File('StormBrigade_White.png')) + else: + embed.set_thumbnail(url=shieldURL) + return embed \ No newline at end of file diff --git a/helpers.py b/helpers.py index e69de29..b7afde6 100644 --- a/helpers.py +++ b/helpers.py @@ -0,0 +1,30 @@ +import sqlite3 +from sqlite3 import Cursor, Error +def sql_set(query = None,data = None): + if query == None: return + try: + con = sqlite3.connect('sbsheriff.sqlite') + cur = con.cursor() + cur.execute(query,data) + cur.close() + con.commit() + con.close() + + except Error as e: + print(e) + return Error + +def sql_get(query = None): + if query == None: return + try: + con = sqlite3.connect('sbsheriff.sqlite') + cur = con.cursor() + cur.execute(query) + re = cur.fetchall() + cur.close() + con.close() + return re + + except Error as e: + print(e) + return Error diff --git a/main.py b/main.py index e69de29..23c7385 100644 --- a/main.py +++ b/main.py @@ -0,0 +1,426 @@ +import disnake +from disnake.ext import commands +import json +import modals +import helpers +import time +import embed_factory +from disnake.ext import tasks +import sqlite3 +from sqlite3 import Cursor, Error +import asyncio +import botOptions +import bingo +import random +import math +import os +from datetime import datetime,timezone +import datetime +import sbclasses +import requests + +intents = disnake.Intents().all() + +bot = commands.Bot( + command_preifx='%', + sync_commands_debug=False, + intents=intents +) + + +@bot.event +async def on_ready(): + print('Logged In') + +@bot.slash_command(description='List some villages in need of LL') +async def ll(inter:disnake.ApplicationCommandInteraction): + playerCP = helpers.sql_get("SELECT cp,prefPikes,prefArchers FROM user WHERE dID = {dID}".format(dID=inter.author.id)) + print(playerCP) + cp = 0 + prefArcher = 300 + prefPikes = 200 + if len(playerCP): + cp = int(playerCP[0][0]) + if playerCP[0][1] != None: + prefArcher = int(playerCP[0][2]) + prefPikes = int(playerCP[0][1]) + await inter.response.send_modal(modal=modals.LLModal(cp=cp,pike=prefPikes,archer=prefArcher)) + +@bot.event +async def on_guild_available(guild): + helpers.sql_set('INSERT INTO guild(gID,name) VALUES(?,?) ON CONFLICT DO NOTHING',(guild.id,guild.name)) + +typeList = ['ll'] +@bot.slash_command(description='set LL advert channel') +async def create_advert(inter:disnake.ApplicationCommandInteraction,advert_type:str = commands.Param(description='What type=',choices=typeList), target: disnake.abc.GuildChannel = commands.Param(description='Channel override, optional')): + embed = disnake.Embed(title='Looking for Liege Lords') + result = json.loads(helpers.sql_get("SELECT lldata FROM guild WHERE gID = {gID}".format(gID = inter.guild.id))[0][0]) + if advert_type not in result: + message = await target.send(embed=embed) + await message.create_thread(name="Requests") + result[advert_type] = (message.channel.id,message.id) + helpers.sql_set("INSERT INTO guild(gID,lldata) VALUES(?,?) ON CONFLICT DO UPDATE SET lldata = excluded.lldata",(message.guild.id,json.dumps(result))) + else: + await inter.response.send_message(content="Already set",ephemeral=True) + +@bot.slash_command(description="List some info about target") +async def check_player(inter:disnake.ApplicationCommandInteraction,user:str = commands.Param(description='Player Name')): + embed = embed_factory.check_player(user) + await inter.response.send_message(embed=embed) + + +@bot.event +async def on_message_interaction(inter:disnake.MessageInteraction): + if inter.component.custom_id == 'llcheck' and not inter.response.is_done(): + await inter.response.defer(ephemeral=True) + inter.component.disabled = True + ll_data_dict = json.loads(helpers.sql_get("SELECT lldata FROM guild WHERE gID = {gid}".format(gid=inter.guild.id))[0][0]) + ll_channel = inter.guild.get_channel_or_thread(ll_data_dict['ll'][0]) + ll_thread_message = await ll_channel.fetch_message(ll_data_dict['ll'][1]) + helpers.sql_set("UPDATE llrequests SET fulfilled = ? WHERE messageID = ?",(time.time(),inter.message.id)) + await ll_thread_message.edit(embed= embed_factory.lfll(ll_data_dict['ll'][1])) + + message = await inter.message.delete() + + + return + + + + +timedAttacks = {} +timesMessages = {} + + +def sql_connection(): + try: + + con = sqlite3.connect('sbingo2.sqlite') + + return con + + except Error: + + print(Error) + +def sql_setSeed(con,entry): + cursorObj = con.cursor() + cursorObj.execute('INSERT INTO overrides(dID,seed) VALUES(?,?) ON CONFLICT(dID) DO UPDATE SET seed = excluded.seed',entry) + cursorObj.close() + con.commit() + +def sql_setCard(con,entry): + cursorObj = con.cursor() + cursorObj.execute('INSERT INTO defaultCard(dID,speed) VALUES(?,?) ON CONFLICT(dID) DO UPDATE SET speed = excluded.speed',entry) + cursorObj.close() + con.commit() + +def sql_getCard(con,id): + cursorObj = con.cursor() + query = 'SELECT speed FROM defaultCard WHERE dID = '+str(id) + cursorObj.execute(query) + result = cursorObj.fetchall() + cursorObj.close() + if len(result) == 1: + return result[0][0] + return result + +def sql_addVM(con,name,dateTime): + ok = True + data = (name.lower(),dateTime) + cursorObj = con.cursor() + try: + cursorObj.execute('INSERT INTO vecations(name,date) VALUES(?,?)',data) + except Error: + ok = False + cursorObj.close() + con.commit() + return ok + +def sql_getVM(con): + cursorObj = con.cursor() + cursorObj.execute('SELECT * FROM vecations where date > unixepoch("now","-14 days");') + result = cursorObj.fetchall() + cursorObj.close() + return result + +def sql_getSeed(con,id): + cursorObj = con.cursor() + query = 'SELECT dID, seed FROM overrides WHERE dID = '+str(id) + cursorObj.execute(query) + result = cursorObj.fetchall() + cursorObj.close() + return result + +def generateBingoCard(display_name, id): + bingoimg = bingo.generate_bingo(display_name,id) + bingoimg.save(display_name+'.png') + +@bot.event +async def on_message(message): + if message.author == bot.user: + return + + if message.content.startswith(botOptions.prefix): + #Potential command + command = message.content.lower().split()[0][1:] or None + args = message.content.split()[1:] or [None] + match command: + case 'spin': + random.seed(time.time()) + response = bingo.generate_gif_test(str(message.id),1) + await message.channel.send(content='Spinning the wheel for: '+message.author.display_name,file=disnake.File(str(message.id)+".gif")) + if response == 'T2': + await asyncio.sleep(4) + response = bingo.generate_gif_test(str(message.id),2) + await message.channel.send(content='LUCKY! You won another spin!',file=disnake.File(str(message.id)+".gif")) + if response == 'T3': + await asyncio.sleep(4) + response = bingo.generate_gif_test(str(message.id),3) + await message.channel.send(content='SPINTASTIC!!! Max level spin achieved',file=disnake.File(str(message.id)+".gif")) + await asyncio.sleep(4) + await message.channel.send('Congratulations! You won: '+response) + os.remove(str(message.id)+".gif") + case 'bingo': + seed = sql_getSeed(con,message.author.id) + if seed: + generateBingoCard(message.author.display_name,seed[0][1]) + else: + generateBingoCard(message.author.display_name,message.author.id) + await message.channel.send(content='Here is your bingo card, if you find something impossible ask for an override!',file=disnake.File(message.author.display_name+".png")) + os.remove(message.author.display_name+".png") + case 'reroll': + if message.author.id in botOptions.verifiedUsers: + if len(args) != 1: + await message.channel.send('Expecting an user ID') + elif not args[0].isnumeric(): + await message.channel.send('The argument needs to be the user ID') + else: + target = message.guild.get_member(int(args[0])) + print(args) + print(message.guild) + print(target) + if target == None: + await message.channel.send("Can't find the user in this disnake") + await message.delete() + return + newRandom = math.floor(random.random()*100000000000) + sql_setSeed(con,(target.id,newRandom)) + generateBingoCard(target.display_name,newRandom) + await message.channel.send('New seed set!',file=disnake.File(target.display_name+".png")) + os.remove(target.display_name+".png") + case 'vm': + if len(args) < 1 or args[0] == 'list': + vms = sql_getVM(con) + print(datetime.fromtimestamp(vms[0][1],timezone.utc)) + vmList = 'Players potentially still on VM:' + if len(vms) == 0: + vmList += '\n-None' + else: + for player in vms: + vmList += '\n'+player[0]+' - ' + await message.channel.send(vmList) + if len(args) == 1: + if sql_addVM(con,args[0],message.created_at.replace(tzinfo=timezone.utc).timestamp()): + await message.channel.send(args[0]+' Added to VM list!') + else: + await message.channel.send(args[0]+' Is already on the list') + case 'test': + editAttack = timedAttacks[args[0]] + editAttack.setMark(time.time()) + + case ('timed'|'attack'|'countdown'): + #validate args + if len(args) <= 1: + if args[0] == 'help' or args[0] == None: + embed = disnake.Embed(color=0x5eb4ee,title="<:SB:947837030782615613> Sheriff Timed Attacks for dummies!"\ + ,description="The SB Sheriff can keep track of your times and participating villas!\nThis can be used to keep track of targets and work out what to set the timer to,\n but it can also show a countdown for each attack \ + Granted this can be a bit slow, and inconvenient for some, but on large timed operations or keeping track of multiple attacks it can be quite useful!\n\n \ + The only command needed is: **{prefix}timed