-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.py
46 lines (37 loc) · 1.28 KB
/
demo.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
"""A file to show a demo of dpylint. for actual testing see the test directory"""
from discord.ext import commands
@commands.command()
@commands.has_permissions(manage_messages="a")
async def test(ctx):
"""Tests the permission value passed to has_permissions"""
await ctx.send("hi")
@commands.command()
@commands.has_permissions(manage_server=True)
async def test(ctx):
"""Tests the permission name passed to has_permissions"""
await ctx.send("hi")
@commands.command()
@commands.has_permissions()
async def test(ctx):
"""Tests if any permissions were passed to has_permissions"""
await ctx.send("hi")
@commands.Cog.listener("on_ready")
async def test(ctx):
"""Tests if the parameters taken in the function match the parameters that the event has"""
return ctx
@commands.Cog.listener()
async def on_message(message, user):
"""Tests if the parameters taken in the function match the parameters that the event has"""
return message, user
@commands.Cog.listener("on_tpying")
async def test(ctx):
"""Tests if the event name is right"""
return ctx
@commands.Cog.listener()
async def on_guld_jon(ctx):
"""Tests if the event name is right"""
return ctx
class MyBot(commands.Bot):
"""Custom bot subclass demo"""
client = commands.Bot("!")
client = MyBot()