Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Commit

Permalink
add botserver function (invite to main server)
Browse files Browse the repository at this point in the history
  • Loading branch information
raiden-e committed Mar 17, 2021
1 parent 88f0c90 commit 504ed08
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions cogs/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import config
import psutil
from utils import default
from utils import default, permissions

import discord
from discord.ext import commands
Expand Down Expand Up @@ -43,14 +43,32 @@ async def source(self, ctx):
@commands.command(aliases=['supportserver', 'feedbackserver'])
async def botserver(self, ctx):
""" Get an invite to our support server! """
async def get_inv():
guild = self.bot.get_guild(config.INVITE[0])
channel = guild.get_channel(config.INVITE[1])
return await channel.create_invite(
max_age=300, max_uses=1, reason="botserver")
try:
if isinstance(ctx.channel, discord.DMChannel) or ctx.guild.id != config.BOTSERVER:
return await ctx.send(f"**Here you go {ctx.author.name} 🍻\n<{config.BOTSERVER}>**")
await ctx.send(f"**{ctx.author.name}**, this is my home you know")
if isinstance(ctx.channel, discord.DMChannel):
await ctx.author.send(f"Here you go, **{ctx.author}**!\n{await get_inv()}")
else:
if ctx.guild.id == config.INVITE[0]:
await ctx.send(f"**{ctx.author.name}**, this is my home you know")
else:
await ctx.author.send(f"Here you go, **{ctx.author}**!\n{await get_inv()}")
if permissions.can_handle(ctx, "add_reactions"):
await ctx.message.add_reaction(chr(0x2709))
else:
await ctx.send("Check ur dm's")
except AttributeError as e:
await ctx.send(f"Where did I come from!?!")
raise e

@commands.command(aliases=['ver'])
async def version(self, ctx):
""" Get an invite to our support server! """
return await ctx.send(f"Im on another level!\nversion: **{config.VERSION}**")

@commands.command(aliases=['info', 'stats', 'status'])
async def about(self, ctx):
""" About the bot """
Expand Down

0 comments on commit 504ed08

Please sign in to comment.