Skip to content
This repository has been archived by the owner on Aug 1, 2021. It is now read-only.

Commit

Permalink
Removed storage related examples (#59)
Browse files Browse the repository at this point in the history
* Remove storage.py

* Removed storage related comands
  • Loading branch information
MrLotU authored and b1naryth1ef committed Dec 8, 2017
1 parent 15138e9 commit bc3228d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 57 deletions.
24 changes: 0 additions & 24 deletions examples/basic_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,6 @@ def on_math_add_command(self, event, a, b):
def on_math_sub_command(self, event, a, b):
event.msg.reply('{}'.format(a - b))

@Plugin.command('tag', '<name:str> [value:str...]')
def on_tag(self, event, name, value=None):
# Plugins can easily store data locally using Disco's built in storage
tags = self.storage.guild.ensure('tags')

if value:
tags[name] = value
event.msg.reply(u':ok_hand: created tag `{}`'.format(S(name)))
else:
if name in tags:
return event.msg.reply(tags[name])
else:
return event.msg.reply(u'Unknown tag: `{}`'.format(S(name)))

@Plugin.command('test', parser=True)
@Plugin.parser.add_argument('-a', '--asdf', help='wow')
@Plugin.parser.add_argument('--help', action='store_true')
Expand All @@ -87,13 +73,3 @@ def on_test(self, event, args):
if args.help:
return event.msg.reply(event.parser.format_help())
event.msg.reply(args.asdf)

"""
@Plugin.route('/test')
def on_test_route(self):
# Disco has built-in support for Flask (if installed and enabled) which
# allows plugins to create HTTP routes.
from flask import request
print dict(request.headers)
return 'Hi!'
"""
33 changes: 0 additions & 33 deletions examples/storage.py

This file was deleted.

0 comments on commit bc3228d

Please sign in to comment.