Code Duplication    Length = 15-15 lines in 2 locations

sopel/modules/adminchannel.py 2 locations

@@ 47-61 (lines=15) @@
44
    bot.write(['MODE', channel, "+o", nick])
45
46
47
@require_chanmsg
48
@require_privilege(OP, 'You are not a channel operator.')
49
@commands('deop')
50
def deop(bot, trigger):
51
    """
52
    Command to deop users in a room. If no nick is given,
53
    Sopel will deop the nick who sent the command
54
    """
55
    if bot.channels[trigger.sender].privileges[bot.nick] < OP:
56
        return bot.reply("I'm not a channel operator!")
57
    nick = trigger.group(2)
58
    channel = trigger.sender
59
    if not nick:
60
        nick = trigger.nick
61
    bot.write(['MODE', channel, "-o", nick])
62
63
64
@require_chanmsg
@@ 30-44 (lines=15) @@
27
    return '{} {} {} {}'.format(welcome, chan, topic_, arg)
28
29
30
@require_chanmsg
31
@require_privilege(OP, 'You are not a channel operator.')
32
@commands('op')
33
def op(bot, trigger):
34
    """
35
    Command to op users in a room. If no nick is given,
36
    Sopel will op the nick who sent the command
37
    """
38
    if bot.channels[trigger.sender].privileges[bot.nick] < OP:
39
        return bot.reply("I'm not a channel operator!")
40
    nick = trigger.group(2)
41
    channel = trigger.sender
42
    if not nick:
43
        nick = trigger.nick
44
    bot.write(['MODE', channel, "+o", nick])
45
46
47
@require_chanmsg