Merge branch 'master' into howdoi

# Conflicts:
#	howdoi/howdoi.py
#	howdoi/howdoi_source.py
#	howdoi/info.json
howdoi
bobloy 6 years ago
commit 4efb836973

@ -1,22 +0,0 @@
from .fight import Fight
# def check_folders():
# if not os.path.exists("data/Fox-Cogs"):
# print("Creating data/Fox-Cogs folder...")
# os.makedirs("data/Fox-Cogs")
# if not os.path.exists("data/Fox-Cogs/fight"):
# print("Creating data/Fox-Cogs/fight folder...")
# os.makedirs("data/Fox-Cogs/fight")
# def check_files():
# if not dataIO.is_valid_json("data/Fox-Cogs/fight/fight.json"):
# dataIO.save_json("data/Fox-Cogs/fight/fight.json", {})
def setup(bot):
# check_folders()
# check_files()
n = Fight(bot)
bot.add_cog(n)

File diff suppressed because it is too large Load Diff

@ -1,10 +0,0 @@
{
"author" : ["Bobloy"],
"bot_version" : [3,0,0],
"description" : "[Incomplete] Cog to organize tournaments within Discord",
"hidden" : true,
"install_msg" : "Thank you for installing Fight. Run with [p]fight or [p]fightset",
"requirements" : [],
"short" : "[Incomplete] Cog to organize tournaments",
"tags" : ["game", "fun", "fight", "tournament", "tourney", "elimination", "bracket", "bobloy"]
}

@ -1,5 +0,0 @@
from .nudity import Nudity
def setup(bot):
bot.add_cog(Nudity(bot))

@ -1,20 +0,0 @@
{
"author": [
"Bobloy"
],
"bot_version": [
3,
0,
0
],
"description": "Keep track of when users were last seen online",
"hidden": true,
"install_msg": "Thank you for installing LastSeen. Get started with `[p]load nudity`, then `[p]help Nudity`",
"requirements": ["nudepy"],
"short": "Last seen tracker",
"tags": [
"bobloy",
"utils",
"tools"
]
}

@ -1,45 +0,0 @@
from datetime import datetime
import discord
import nude
from nude import Nude
from redbot.core import Config
from redbot.core import commands
from redbot.core.bot import Red
class Nudity:
"""
V3 Cog Template
"""
online_status = discord.Status.online
offline_status = discord.Status.offline
def __init__(self, bot: Red):
self.bot = bot
self.config = Config.get_conf(self, identifier=9811198108111121, force_registration=True)
default_guild = {
"enabled": False
}
self.config.register_guild(**default_guild)
@commands.command(aliases=['togglenudity'], name='nudity')
async def nudity(self, ctx: commands.Context):
"""Toggle nude-checking on or off"""
is_on = await self.config.guild(ctx.guild).enabled()
await self.config.guild(ctx.guild).enabled.set(not is_on)
await ctx.send("Nude checking is now set to {}".format(not is_on))
async def on_message(self, message: discord.Message):
is_on = await self.config.guild(message.guild).enabled()
if not is_on:
return
if not message.attachments:
return

@ -1,5 +0,0 @@
from .secrethitler import Werewolf
def setup(bot):
bot.add_cog(Werewolf(bot))

@ -1,114 +0,0 @@
import asyncio
import discord
from redbot.core import Config, commands
from datetime import datetime, timedelta
from werewolf.game import Game
class Werewolf:
"""
Base to host werewolf on a guild
"""
def __init__(self, bot):
self.bot = bot
self.config = Config.get_conf(self, identifier=87101114101119111108102, force_registration=True)
default_global = {}
default_guild = {
}
self.config.register_global(**default_global)
self.config.register_guild(**default_guild)
self.games = {} # Active games stored here, id is per guild
@commands.group()
async def ww(self, ctx: commands.Context):
"""
Base command for this cog. Check help for the commands list.
"""
if ctx.invoked_subcommand is None:
pass
@ww.command()
async def new(self, ctx, game_code):
"""
Create and join a new game of Werewolf
"""
game = self._get_game(ctx.guild, game_code)
if not game:
await ctx.send("Failed to start a new game")
else:
await ctx.send("New game has started")
@ww.command()
async def join(self, ctx):
"""
Joins a game of Werewolf
"""
game = self._get_game(ctx.guild)
if not game:
await ctx.send("No game to join!\nCreate a new one with `[p]ww new`")
return
await game.join(ctx.author, ctx.channel)
@ww.command()
async def quit(self, ctx):
"""
Quit a game of Werewolf
"""
game = self._get_game(ctx.guild)
await game.quit(ctx.author, ctx.channel)
@ww.command()
async def start(self, ctx):
"""
Checks number of players and attempts to start the game
"""
game = self._get_game(ctx.guild)
if not game:
await ctx.send("No game running, cannot start")
await game.setup(ctx)
@ww.command()
async def vote(self, ctx, id):
"""
Vote for a player by ID
"""
game = self._get_game(ctx.guild)
if not game:
await ctx.send("No game running, cannot vote")
# Game handles response now
channel = ctx.channel
if channel is game.village_channel:
await game.vote(ctx.author, id, channel)
if channel in (c["channel"] for c in game.p_channels.values()):
await game.vote(ctx.author, id, channel)
def _get_game(self, guild, game_code=None):
if guild.id not in self.games:
if not game_code:
return None
self.games[guild.id] = Game(guild, game_code)
return self.games[guild.id]
async def _game_start(self, game):
await game.start()
Loading…
Cancel
Save