This commit is contained in:
NikolajDanger
2020-08-13 17:09:26 +02:00
parent b82d233faf
commit 4ee96cd3b5
10 changed files with 14 additions and 19 deletions

View File

@ -1,8 +1,8 @@
import discord, os, finnhub, pymongo import discord, os, finnhub
from discord.ext import commands from discord.ext import commands
from pymongo import MongoClient from pymongo import MongoClient
from funcs import logThis, makeFiles, transferUsers, Money, Funcs, SwChar, SwDestiny, SwRoll, Games from funcs import logThis, makeFiles, Money, Funcs, SwChar, SwDestiny, SwRoll, Games
commandPrefix = "!" commandPrefix = "!"
@ -55,9 +55,6 @@ makeFiles()
# Creates the Bot # Creates the Bot
client = Gwendolyn() client = Gwendolyn()
# Creates database collections
transferUsers(client.database)
# Logs in # Logs in
@client.event @client.event
async def on_ready(): async def on_ready():

View File

@ -8,7 +8,7 @@ class LookupCog(commands.Cog):
def __init__(self,client): def __init__(self,client):
"""Runs lookup commands.""" """Runs lookup commands."""
self.client = client self.client = client
# Looks up a spell # Looks up a spell
@commands.command() @commands.command()
async def spell(self, ctx, *, content): async def spell(self, ctx, *, content):
@ -18,7 +18,7 @@ class LookupCog(commands.Cog):
await ctx.send(spell[2000:]) await ctx.send(spell[2000:])
else: else:
await ctx.send(spell) await ctx.send(spell)
# Looks up a monster # Looks up a monster
@commands.command() @commands.command()
async def monster(self, ctx, *, content): async def monster(self, ctx, *, content):

View File

@ -17,7 +17,7 @@ class SwCog(commands.Cog):
messageList = newMessage.split("\n") messageList = newMessage.split("\n")
for messageItem in messageList: for messageItem in messageList:
await ctx.send(messageItem) await ctx.send(messageItem)
# Controls destiny points # Controls destiny points
@commands.command() @commands.command()
async def swd(self, ctx, *, content): async def swd(self, ctx, *, content):
@ -25,7 +25,7 @@ class SwCog(commands.Cog):
messageList = newMessage.split("\n") messageList = newMessage.split("\n")
for messageItem in messageList: for messageItem in messageList:
await ctx.send(messageItem) await ctx.send(messageItem)
# Rolls for critical injuries # Rolls for critical injuries
@commands.command() @commands.command()
async def swcrit(self, ctx, arg : int = 0): async def swcrit(self, ctx, arg : int = 0):
@ -34,7 +34,7 @@ class SwCog(commands.Cog):
messageList = newMessage.split("\n") messageList = newMessage.split("\n")
for messageItem in messageList: for messageItem in messageList:
await ctx.send(messageItem) await ctx.send(messageItem)
# Accesses and changes character sheet data with the parseChar function # Accesses and changes character sheet data with the parseChar function
# from funcs/swfuncs/swchar.py # from funcs/swfuncs/swchar.py
@commands.command(aliases=["sw"]) @commands.command(aliases=["sw"])

View File

@ -229,7 +229,7 @@ class Blackjack():
# When players try to double down # When players try to double down
def blackjackDouble(self,channel,user,handNumber = 0): def blackjackDouble(self,channel,user,handNumber = 0):
game = self.bot.database["blackjack games"].find_one({"_id":channel}) game = self.bot.database["blackjack games"].find_one({"_id":channel})
if user in game["user hands"]: if user in game["user hands"]:
hand, handNumber = self.getHandNumber(game["user hands"][user],handNumber) hand, handNumber = self.getHandNumber(game["user hands"][user],handNumber)

View File

@ -1,7 +1,6 @@
import random import random
import copy import copy
import math import math
import asyncio
from .fourInARowDraw import DrawFourInARow from .fourInARowDraw import DrawFourInARow
from funcs import logThis from funcs import logThis
@ -128,8 +127,8 @@ class FourInARow():
def placeOnBoard(self,board,player,column): def placeOnBoard(self,board,player,column):
placementx, placementy = -1, column placementx, placementy = -1, column
for x in range(len(board)): for x, line in enumerate(board):
if board[x][column] == 0: if line[column] == 0:
placementx = x placementx = x
board[placementx][placementy] = player board[placementx][placementy] = player

View File

@ -2,7 +2,6 @@ import json
import urllib import urllib
import random import random
from . import money
from funcs import logThis from funcs import logThis
class Trivia(): class Trivia():

View File

@ -101,7 +101,7 @@ def monsterFunc(command):
hit_dice += (" - "+str(con_mod * int(monster["hit_dice"].replace("d"," ").split()[0])*(-1))) hit_dice += (" - "+str(con_mod * int(monster["hit_dice"].replace("d"," ").split()[0])*(-1)))
if con_mod > 0: if con_mod > 0:
hit_dice += (" + "+str(con_mod * int(monster["hit_dice"].replace("d"," ").split()[0]))) hit_dice += (" + "+str(con_mod * int(monster["hit_dice"].replace("d"," ").split()[0])))
new_part = "\n--------------------" new_part = "\n--------------------"
monster_type = monster["size"]+" "+typs+", "+monster["alignment"]+"*" monster_type = monster["size"]+" "+typs+", "+monster["alignment"]+"*"

View File

@ -29,7 +29,7 @@ def nameGen():
# Choses a random first letter # Choses a random first letter
first_letter = random.choice(corpus) first_letter = random.choice(corpus)
# Makes sure the first letter is not something a name can't start with. # Makes sure the first letter is not something a name can't start with.
while first_letter.islower() or first_letter == " " or first_letter == "-" or first_letter == "\n": while first_letter.islower() or first_letter == " " or first_letter == "-" or first_letter == "\n":
first_letter = random.choice(corpus) first_letter = random.choice(corpus)

View File

@ -280,7 +280,7 @@ class SwChar():
except: except:
logThis("Nope. That didn't happen (error code 942)") logThis("Nope. That didn't happen (error code 942)")
return "Can't do that (error code 942)" return "Can't do that (error code 942)"
if (key == "Talents" or key == "Force-powers") and "," in cmd: if (key == "Talents" or key == "Force-powers") and "," in cmd:
cmd = cmd.split(",") cmd = cmd.split(",")
while cmd[1][0] == " ": while cmd[1][0] == " ":

View File

@ -188,7 +188,7 @@ class SwRoll():
emoji += "<:light:691010089905029171>" emoji += "<:light:691010089905029171>"
elif char == 'B': elif char == 'B':
emoji += "<:dark:691010101901000852>" emoji += "<:dark:691010101901000852>"
return emoji return emoji
# Converts emoji into letters # Converts emoji into letters