Create suggestions
table if missing
This commit is contained in:
parent
67d52a8fd8
commit
18e9490936
@ -14,7 +14,7 @@ __author__ = "Davide Testa"
|
||||
__email__ = "davide@davte.it"
|
||||
__credits__ = ["Marco Origlia", "Nick Lee @Nickoala"]
|
||||
__license__ = "GNU General Public License v3.0"
|
||||
__version__ = "2.4.2"
|
||||
__version__ = "2.4.3"
|
||||
__maintainer__ = "Davide Testa"
|
||||
__contact__ = "t.me/davte"
|
||||
|
||||
|
@ -257,6 +257,30 @@ def init(telegram_bot: davtelepot.bot.Bot, suggestion_messages=default_suggestio
|
||||
+ suggestion_messages['suggestions_command']['aliases']
|
||||
)
|
||||
|
||||
db = telegram_bot.db
|
||||
types = db.types
|
||||
if 'suggestions' not in db.tables:
|
||||
table = db.create_table(
|
||||
table_name='suggestions'
|
||||
)
|
||||
table.create_column(
|
||||
'user_id',
|
||||
types.integer
|
||||
)
|
||||
table.create_column(
|
||||
'suggestion',
|
||||
types.text
|
||||
)
|
||||
table.create_column(
|
||||
'created',
|
||||
types.datetime
|
||||
)
|
||||
table.create_column(
|
||||
'sent',
|
||||
types.datetime
|
||||
)
|
||||
|
||||
|
||||
@telegram_bot.command(command=suggestion_messages['suggestions_command']['command'],
|
||||
aliases=suggestion_messages['suggestions_command']['aliases'],
|
||||
reply_keyboard_button=(
|
||||
|
Loading…
x
Reference in New Issue
Block a user