2019-01-15 01:48:23 +00:00
|
|
|
import discord
|
2018-12-23 13:48:15 +00:00
|
|
|
from discord.ext import commands
|
2019-02-28 22:10:30 +00:00
|
|
|
from discord.ext.commands import Cog
|
2018-12-23 13:48:15 +00:00
|
|
|
|
2019-06-03 22:14:19 +00:00
|
|
|
|
2019-02-28 22:10:30 +00:00
|
|
|
class Links(Cog):
|
2018-12-23 13:48:15 +00:00
|
|
|
"""
|
|
|
|
Commands for easily linking to projects.
|
|
|
|
"""
|
|
|
|
|
|
|
|
def __init__(self, bot):
|
|
|
|
self.bot = bot
|
|
|
|
|
|
|
|
@commands.command(hidden=True)
|
|
|
|
async def pegaswitch(self, ctx):
|
2018-12-23 19:06:32 +00:00
|
|
|
"""Link to the Pegaswitch repo"""
|
2018-12-23 13:48:15 +00:00
|
|
|
await ctx.send("https://github.com/reswitched/pegaswitch")
|
|
|
|
|
2018-12-23 19:06:32 +00:00
|
|
|
@commands.command(hidden=True, aliases=["atmos"])
|
2018-12-23 22:11:01 +00:00
|
|
|
async def atmosphere(self, ctx):
|
2018-12-23 19:06:32 +00:00
|
|
|
"""Link to the Atmosphere repo"""
|
|
|
|
await ctx.send("https://github.com/atmosphere-nx/atmosphere")
|
2018-12-23 22:11:01 +00:00
|
|
|
|
2019-01-05 20:27:47 +00:00
|
|
|
@commands.command(hidden=True, aliases=["xyproblem"])
|
|
|
|
async def xy(self, ctx):
|
|
|
|
"""Link to the "What is the XY problem?" post from SE"""
|
2020-04-20 22:05:32 +00:00
|
|
|
await ctx.send(
|
|
|
|
"<https://meta.stackexchange.com/q/66377/285481>\n\n"
|
|
|
|
"TL;DR: It's asking about your attempted solution "
|
|
|
|
"rather than your actual problem.\n"
|
|
|
|
"It's perfectly okay to want to learn about a "
|
|
|
|
"solution, but please be clear about your intentions "
|
|
|
|
"if you're not actually trying to solve a problem."
|
|
|
|
)
|
2019-01-05 20:27:47 +00:00
|
|
|
|
2019-01-08 08:30:25 +00:00
|
|
|
@commands.command(hidden=True, aliases=["guides", "link"])
|
2018-12-23 19:06:32 +00:00
|
|
|
async def guide(self, ctx):
|
2020-04-20 22:31:04 +00:00
|
|
|
"""Link to the guides"""
|
2023-04-05 10:10:18 +00:00
|
|
|
await ctx.send(self.bot.config.links_guide_text)
|
2018-12-23 22:11:01 +00:00
|
|
|
|
2019-01-15 01:48:23 +00:00
|
|
|
@commands.command()
|
|
|
|
async def source(self, ctx):
|
|
|
|
"""Gives link to source code."""
|
2020-04-20 22:05:32 +00:00
|
|
|
await ctx.send(
|
2023-04-05 10:10:18 +00:00
|
|
|
f"You can find my source at {self.bot.config.source_url}. "
|
2020-04-20 22:05:32 +00:00
|
|
|
"Serious PRs and issues welcome!"
|
|
|
|
)
|
2019-01-15 01:48:23 +00:00
|
|
|
|
|
|
|
@commands.command()
|
|
|
|
async def rules(self, ctx, *, targetuser: discord.Member = None):
|
|
|
|
"""Post a link to the Rules"""
|
|
|
|
if not targetuser:
|
|
|
|
targetuser = ctx.author
|
2020-04-20 22:05:32 +00:00
|
|
|
await ctx.send(
|
|
|
|
f"{targetuser.mention}: A link to the rules "
|
2023-04-05 10:10:18 +00:00
|
|
|
f"can be found here: {self.bot.config.rules_url}"
|
2020-04-20 22:05:32 +00:00
|
|
|
)
|
2019-01-15 01:48:23 +00:00
|
|
|
|
2019-02-18 16:17:46 +00:00
|
|
|
@commands.command()
|
|
|
|
async def community(self, ctx, *, targetuser: discord.Member = None):
|
|
|
|
"""Post a link to the community section of the rules"""
|
|
|
|
if not targetuser:
|
|
|
|
targetuser = ctx.author
|
2020-04-20 22:05:32 +00:00
|
|
|
await ctx.send(
|
|
|
|
f"{targetuser.mention}: "
|
2021-07-15 11:38:18 +00:00
|
|
|
"https://reswitched.github.io/discord/#member-roles-breakdown"
|
2020-04-20 22:05:32 +00:00
|
|
|
"\n\n"
|
|
|
|
"Community role allows access to the set of channels "
|
|
|
|
"on the community category (#off-topic, "
|
|
|
|
"#homebrew-development, #switch-hacking-general etc)."
|
|
|
|
"\n\n"
|
|
|
|
"What you need to get the role is to be around, "
|
|
|
|
"be helpful and nice to people and "
|
|
|
|
"show an understanding of rules."
|
|
|
|
)
|
2019-02-18 16:17:46 +00:00
|
|
|
|
2018-12-23 13:48:15 +00:00
|
|
|
|
2022-05-24 18:35:42 +00:00
|
|
|
async def setup(bot):
|
|
|
|
await bot.add_cog(Links(bot))
|